gradle-node-plugin icon indicating copy to clipboard operation
gradle-node-plugin copied to clipboard

Plugin attempts to download a nonexistent linux-x86 dist

Open Hypnosphi opened this issue 6 years ago • 11 comments

I try to run my gradle task on a linux agent on CI. Here's the relevant part of build.gradle:

plugins {
  id "com.moowork.node" version "1.3.1"
}

node {
  download = true
}

It fails on :nodeSetup task:

[Step 4/4] Execution failed for task ':nodeSetup'. org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':detachedConfiguration1'.
[00:35:17][Step 4/4] Process exited with code 1
[00:35:17][Step 4/4] Gradle failure report
[00:35:17][Gradle failure report] FAILURE: Build failed with an exception.
[00:35:17][Gradle failure report] 
[00:35:17][Gradle failure report] * What went wrong:
[00:35:17][Gradle failure report] Execution failed for task ':nodeSetup'.
[00:35:17][Gradle failure report] > Could not resolve all files for configuration ':detachedConfiguration1'.
[00:35:17][Gradle failure report]    > Could not find org.nodejs:node:10.15.3.
[00:35:17][Gradle failure report]      Searched in the following locations:
[00:35:17][Gradle failure report]        - https://nodejs.org/dist/v10.15.3/ivy.xml
[00:35:17][Gradle failure report]        - https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x86.tar.gz
[00:35:17][Gradle failure report]      Required by:
[00:35:17][Gradle failure report]          project :
[00:35:17][Gradle failure report] 
[00:35:17][Gradle failure report] * Try:
[00:35:17][Gradle failure report] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[00:35:17][Gradle failure report] 
[00:35:17][Gradle failure report] * Get more help at https://help.gradle.org
[00:35:17][Gradle failure report] 
[00:35:17][Gradle failure report] BUILD FAILED in 8s

There's no linux-x86 distribution in https://nodejs.org/dist/v10.15.3/

Hypnosphi avatar Oct 08 '19 12:10 Hypnosphi

That's correct, there's no 32bit version of node v10.15.3, if you want to run it on a 32bit system you'll have to pick an earlier version of node.

deepy avatar Oct 08 '19 12:10 deepy

@deepy actually, the question is why does it try to download an x86 version on 64-bit linux machine (this is Ubuntu 16.04)

paksv avatar Oct 08 '19 13:10 paksv

@paksv probably because it's a 32bit JVM being used. Can you check what ´os.arch´ is being reported by the JVM used by gradle? We've changed this in the fork to better support ARM but it's pretty simple in both cases. https://github.com/node-gradle/gradle-node-plugin/commit/3d33948b5fc38d30208d495290ec87722a31bdff

deepy avatar Oct 09 '19 11:10 deepy

@deepy, thanks, it's indeed because of 32-bit jvm. I have worked around the issue by modifying the getOsArch() and using a locally built package. Would you like me to send a PR for the fix?

paksv avatar Oct 14 '19 12:10 paksv

To be honest, I think this is Working As Intended. Your JVM is reporting 32-bit and 32-bit node is being requested.

If you're on a 64-bit system, why not use a 64-bit JVM?

deepy avatar Oct 14 '19 12:10 deepy

To be honest, I think this is Working As Intended. Your JVM is reporting 32-bit and 32-bit node is being requested.

If you're on a 64-bit system, why not use a 64-bit JVM?

Hi, I am having the same issue. Running in idea IntelliJ on my local 64 bits widows machine with 64bit JAVA. But it still looks for x86. What can I do to ask it to look for x64 folder? Thank you!

Yachin avatar Apr 24 '20 03:04 Yachin

Does it work when you run Gradle from the command-line with a 64-bit JVM? If that doesn't work, check what os.arch is being reported and open an issue at the fork and I can have a look at it.

deepy avatar Apr 24 '20 07:04 deepy

Does it work when you run Gradle from the command-line with a 64-bit JVM? If that doesn't work, check what os.arch is being reported and open an issue at the fork and I can have a look at it.

Hi @deepy , thank you for the quick reply. I just started this job and am very new with gradle. This is how I check os.arch in gradle and it returns amd64 System.getProperty("os.arch"); How can I ask gradle to run 64-bit JVM through command line? Thank you so much!

Yachin avatar Apr 24 '20 12:04 Yachin

Setting JAVA_HOME is probably the way to go there, but if os.arch returns amd64 you're supposed to get an x64 distribution of node, that's what's being used to determine which version to download.

deepy avatar Apr 29 '20 15:04 deepy

@deepy,

Thank you for the reply. Any recommendation I can get the code running on my Windows machine? Thank you.

Yachin

Yachin avatar May 05 '20 13:05 Yachin

Use a 64bit JVM

deepy avatar May 05 '20 13:05 deepy