node-gradle / gradle-node-plugin

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

[bug] Node does not bundle with correct shebang/shims #223

Open gabyx opened 2 years ago

gabyx commented 2 years ago

Due to https://github.com/nodejs/node/issues/42367 could you always execute npm,npx inside its file directory (e.g. node-v17.7.1-linux-x64/bin ?

That would quickly solve this issue.

deepy commented 2 years ago

Reading the bug it sounds like we should be safe though? We're putting node first on the path so the shebang should work

Although based on description it sounds like this could be the same issue as https://github.com/node-gradle/gradle-node-plugin/issues/51 which is that you need a musl build of nodejs (of which there's only unofficial-builds https://unofficial-builds.nodejs.org/download/release/v17.0.1/)

gabyx commented 2 years ago

Ah, really, ok. So you are saying, node is already on the path first. Hm but why then does the execution of npm not work. strange...

I try that later, thanks!

deepy commented 2 years ago

The reason it's saying that is because you need a node built for your operating system (technically libc) So if you try running the same build but in a VM or a container running glibc instead of musl (like the docker image debian:bookworm) then you should see it working fine.

And I think if you try to run the downloaded node directly from their path you'll see the same error (even when using the binary directly)