node-gradle / gradle-node-plugin

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

Ubuntu ARM can't download node archive #282

Closed CorentinEP closed 1 year ago

CorentinEP commented 1 year ago

I have a Ubuntu ARM installed on my Mac M1 max (via Parallels)

Could not resolve all files for configuration ':portal:detachedConfiguration1'. Could not find org.nodejs:node:14.19.3. Searched in the following locations:

This is due because the arch is aarch64 and not arm64.

the only build existing is https://nodejs.org/dist/v14.19.3/node-v14.19.3-linux-arm64.tar.gz

Am I alone in this situation ?

deepy commented 1 year ago

I've got test coverage that says this should work: https://github.com/node-gradle/gradle-node-plugin/blob/master/src/test/groovy/com/github/gradle/node/util/PlatformHelperTest.groovy#L64

Which version of the plugin are you running? And can you clone this repository and run ./gradlew runParameterTest? The output from that is useful for figuring this out, especially the os.arch line

CorentinEP commented 1 year ago

Thank you deepy for your answer. On the project I work, the plugin version is pretty old : 2.2.1. I cloned the repo and the answer is Your os.arch is: 'aarch64' and is parsed as: 'arm64' So I guess it should work very fine the last version of the plugin! Unfortunatly, not sure I can ugrade to version 5 easly

deepy commented 1 year ago

On the bright side, you probably only need to update to 3.0.0! Unfortunately that's probably the only upgrade that's going to require any changes, have a look at the CHANGELOG

If you do upgrade to 3.0.0 you can probably then go directly to 3.6.0. And if you're on Gradle 6.6 or newer straight to 5.0.0 There are some changes but the updates should be relatively straightforward

CorentinEP commented 1 year ago

Thank you for the answer 🙏🏻 Unfortunately, I won't be able to update to 3.0.0 that easily as I work on a pretty big project...

CorentinEP commented 1 year ago

As turnaround, is there a way to set or override the download location to be sure to get right URL ? 😉

deepy commented 1 year ago

If you can get your JVM to say that os.arch is arm64 it's gonna work and possibly break other things in very interesting ways Otherwise upgrading to 3.6.0 gives you an option that may cut build times drastically, even more so if you use build-caching, triple both of the previous estimates if you have a remote build cache

Otherwise, the least bad solution I can suggest is, host an internal mirror of the node.js downloads and manually add the arm64 as aarch64

I've still got some refactors to finish, but when those are done you'd be able to override the download location, but that'd likely be version 6 or 7 😁