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

npm install on alpine is wrong

Open kappelmi opened this issue 6 years ago • 3 comments

Hi i am using this plugin on 2 instances of linux. I have seen following error on 1 of the instance newly added to the system:

Task ':OlisWebGUI:npm_install' is not up-to-date because: Task has not declared any outputs despite executing actions. Starting process 'command '/home/jenkins/slave/workspace/test/workspace/OlisWeb/OlisWebGUI/.gradle/nodejs/node-v12.13.1-linux-x64/bin/npm''. Working directory: /home/jenkins/slave/workspace/test/workspace/OlisWeb/OlisWebGUI Command: /home/jenkins/slave/workspace/test/workspace/OlisWeb/OlisWebGUI/.gradle/nodejs/node-v12.13.1-linux-x64/bin/npm install Successfully started process 'command '/home/jenkins/slave/workspace/test/workspace/OlisWeb/OlisWebGUI/.gradle/nodejs/node-v12.13.1-linux-x64/bin/npm'' env: can't execute 'node': No such file or directory :OlisWebGUI:npm_install (Thread[Execution worker for ':' Thread 5,5,main]) completed. Took 0.066 secs.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':OlisWebGUI:npm_install'.

Process 'command '/home/jenkins/slave/workspace/test/workspace/OlisWeb/OlisWebGUI/.gradle/nodejs/node-v12.13.1-linux-x64/bin/npm'' finished with non-zero exit value 127

after long debugging, i have found out, the linux i am using where this is failing is alpine, and it looks like, node original distro requires libc, but alpine uses musl

analyzing the official docker image from node:alpine it looks like, there is an unofficial distro for alpine linux.

would it be possible to fix the plugin, so it would detect alpine linux and download the proper distro from node/npm ?

Thanks, kappelmi

kappelmi avatar Nov 25 '19 08:11 kappelmi

pls also have a look in this file: https://github.com/nodejs/docker-node/blob/c6bc44e84afcdb81d9749b7b034c60e916a519ad/10/alpine3.10/Dockerfile

kappelmi avatar Nov 25 '19 09:11 kappelmi

@kappelmi I'm experiencing the same issue on alpine, have you found a solution for this?

magro avatar May 03 '20 10:05 magro

It's because alpine uses musl and there's no official nodejs for musl. There's some more info in the fork at https://github.com/node-gradle/gradle-node-plugin/issues/51

deepy avatar May 03 '20 11:05 deepy