node-gradle / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
601 stars 117 forks source link

Can't download old node version on MacBook M1 #257

Closed bartoliniii closed 1 year ago

bartoliniii commented 1 year ago

I have the following error on Mac M1, but on linux/windows it seems to be working: `* What went wrong: Could not determine the dependencies of task ':nodeSetup'.

Failed to query the value of task ':nodeSetup' property 'nodeArchiveFile'. Could not resolve all files for configuration ':detachedConfiguration1'. Could not find org.nodejs:node:12.13.0. Searched in the following locations:

The cause of this issue is that probably there is no arm64 compilation of node for old node version. But can I force plugin to download x64 which is also working on Mac M1?

deepy commented 1 year ago

If you're on a M1 Mac the arm64 version is the proper version, nodejs 16 is the first version supporting M1 Macs though

But if you use an x64 JDK running under rosetta then the plugin will fall back to the x64 node.

My recommendation is to upgrade node though

bartoliniii commented 1 year ago

@deepy Unfortunately I can't. Is it possible to make it work with arm64 JDK? Force URL or something like that?

deepy commented 1 year ago

It's not, and really with the performance improvement you really want the arm64 version There's https://github.com/node-gradle/gradle-node-plugin/issues/234 that's covering this topic though (which contains a suggested fix that'd be accepted as a PR 🙂)