Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script install fails on Node.js 18.18.0 #415

Closed
mauricesnip opened this issue Oct 9, 2023 · 4 comments
Closed

Script install fails on Node.js 18.18.0 #415

mauricesnip opened this issue Oct 9, 2023 · 4 comments

Comments

@mauricesnip
Copy link

mauricesnip commented Oct 9, 2023

Mac OS: 13.4.1
Node.js: 18.18.0 (using nvm)
Yarn: 1.22.19

Hey there!

When trying to do a clean install of a project with [email protected] as a subdependency, I encountered the following error using Node.js 18.18.0:

backend on  main [?] is 📦 v1.0.0 via ⬢ v18.18.0 on 🐳 v24.0.6 (desktop-linux) took 2s 
➜ yarn
yarn install v1.22.19
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...
[6/6] ⡀ sqlite3
[2/6] ⡀ argon2
[3/6] ⡀ isolated-vm
[4/6] ⡀ sharp
error /Users/mauricesnip/repositories/backend/node_modules/isolated-vm: Command failed.
Exit code: 127
Command: prebuild-install || (node-gyp rebuild --release -j 4 && node-gyp clean)
Arguments: 
Directory: /Users/mauricesnip/repositories/backend/node_modules/isolated-vm

Or, when trying with yarn upgrade-interactive:

Error: /Users/mauricesnip/repositories/backend/node_modules/isolated-vm: Command failed.
Exit code: 127
Command: prebuild-install || (node-gyp rebuild --release -j 4 && node-gyp clean)
Arguments: 
Directory: /Users/mauricesnip/repositories/backend/node_modules/isolated-vm
Output:
prebuild-install warn install No prebuilt binaries found (target=18.18.0 runtime=node arch=arm64 libc= platform=darwin)
/bin/sh: node-gyp: command not found
    at ProcessTermError.ExtendableBuiltin (/Users/mauricesnip/.yarn/lib/cli.js:721:66)
    at ProcessTermError.MessageError (/Users/mauricesnip/.yarn/lib/cli.js:750:123)
    at new ProcessTermError (/Users/mauricesnip/.yarn/lib/cli.js:790:113)
    at ChildProcess.<anonymous> (/Users/mauricesnip/.yarn/lib/cli.js:25787:17)
    at ChildProcess.emit (node:events:517:28)
    at maybeClose (node:internal/child_process:1098:16)
    at ChildProcess._handle.onexit (node:internal/child_process:303:5)

Though, everything works just fine when using Node.js 18.17.1.

Any clues on what causes these errors?

Addendum

Node.js 18.18.1 does not fix this.

@mauricesnip mauricesnip changed the title Unable to perform clean install or upgrade using Node.js 18.18.0 Command prebuild-install fails on Node.js 18.18.0 Oct 9, 2023
@mauricesnip mauricesnip changed the title Command prebuild-install fails on Node.js 18.18.0 Command install fails on Node.js 18.18.0 Oct 9, 2023
@mauricesnip mauricesnip changed the title Command install fails on Node.js 18.18.0 Script install fails on Node.js 18.18.0 Oct 11, 2023
@laverdet
Copy link
Owner

node-gyp is included with nodejs. There's something spooky with your environment. Please troubleshoot and let me know what you find.

@mauricesnip
Copy link
Author

For posterity, this probably relates to the following issue: npm/cli#6842 (also addressed here: nodejs/node#49737).

@laverdet
Copy link
Owner

Interesting, it'd definitely be alarming if node-gyp is no longer in npm's path. For what it's worth, I was unable to reproduce on nodejs v18.18.1 but I use a custom installation script which manages multiple built-from-source copies of nodejs.

@mauricesnip
Copy link
Author

Yeah, indeed. Guessing this is permanent, since it was intentional: npm/cli#6554. Perhaps you could add a heads up to README.md?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants