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

Yarn fails to install 6.0.4, but can install 6.0.3 fine #114

Closed
StephanBijzitter opened this issue May 23, 2024 · 9 comments
Closed

Yarn fails to install 6.0.4, but can install 6.0.3 fine #114

StephanBijzitter opened this issue May 23, 2024 · 9 comments

Comments

@StephanBijzitter
Copy link

Yarn tells me:

utf-8-validate@npm:6.0.4 couldn't be built successfully (exit code 1, logs can be found here: C:\Users\stephan\AppData\Local\Temp\xfs-51368c88\build.log)

And the content of the log file (some directory names redacted):

# This file contains the result of Yarn building a package (utf-8-validate@npm:6.0.4)
# Script name: install

node:internal/child_process:421
    throw new ErrnoException(err, 'spawn');
    ^

Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at Object.spawn (node:child_process:761:9)
    at build (C:\Users\stephan\github\redacted\Redacted\node_modules\node-gyp-build\bin.js:29:8)
    at preinstall (C:\Users\stephan\github\redacted\Redacted\node_modules\node-gyp-build\bin.js:38:32)
    at C:\Users\stephan\github\redacted\Redacted\node_modules\node-gyp-build\bin.js:11:7
    at ChildProcess.exithandler (node:child_process:430:5)
    at ChildProcess.emit (node:events:518:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:518:28) {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'spawn'
}

Node.js v20.12.2

To reproduce:

nvm install 20.12.2
nvm use 20.12.2
yarn add utf-8-validate@6.0.4
@lpinca
Copy link
Member

lpinca commented May 24, 2024

I can't reproduce the issue:

$ nvm use 20.12.2
Now using node v20.12.2 (npm v10.5.0)
$ yarn -v
1.22.22
$ yarn add utf-8-validate@6.0.4
yarn add v1.22.22
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 2 new dependencies.
info Direct dependencies
└─ utf-8-validate@6.0.4
info All dependencies
├─ node-gyp-build@4.8.1
└─ utf-8-validate@6.0.4
Done in 0.33s.

@GleyderC
Copy link

Hello @StephanBijzitter ,
This is also happening to me, the thing here is 6.0.4 includes a major version of node-gyp, which has a couple of breaking changes, take a look at those changes, they might be affecting you nodejs/node-gyp@4c302ca

@lpinca
Copy link
Member

lpinca commented May 24, 2024

node-gyp is a dev dependency that is not installed.

@lpinca
Copy link
Member

lpinca commented May 24, 2024

See prebuild/node-gyp-build#68.

@lpinca
Copy link
Member

lpinca commented May 24, 2024

Try to regenerate your lock file so that utf-8-validate picks node-gyp-build@4.8.1 (the latest version).

@StephanBijzitter
Copy link
Author

The node-gyp-build version that was installed was:

"node-gyp-build@npm:^4.3.0":
  version: 4.3.0
  resolution: "node-gyp-build@npm:4.3.0"
  bin:
    node-gyp-build: bin.js
    node-gyp-build-optional: optional.js
    node-gyp-build-test: build-test.js
  checksum: 10/673bd8f12694cc226747333fc181a7288e32dc96e88067bccb9ae3969ed1459fe461f85ad76d0ec8566ec1ae75c179e7a6667b0094cc78c9431ecfc95b5c24aa
  languageName: node
  linkType: hard

After removing it from the lockfile and letting yarn re-install it:

"node-gyp-build@npm:^4.3.0":
version: 4.8.1
resolution: "node-gyp-build@npm:4.8.1"
bin:
  node-gyp-build: bin.js
  node-gyp-build-optional: optional.js
  node-gyp-build-test: build-test.js
checksum: 10/b9297770f96a92e5f2b854f3fd5e4bd418df81d7785a81ab60cec5cf2e5e72dc2c3319808978adc572cfa3885e6b12338cb5f4034bed2cab35f0d76a4b75ccdf
languageName: node
linkType: hard

Running yarn add utf-8-validate@6.0.4

➤ YN0000: ┌ Link step
➤ YN0007: │ utf-8-validate@npm:6.0.4 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 2s 554ms

Nice. Thanks for the help lads!

(So I guess the steps to reproduce were indeed a bit lackluster, as on a clean install you'd likely already get the up-to-date version of node-gyp-build)

@nikosszzz
Copy link

I had the same issue, but I'm using PNPM. I only got it to work by changing the lockfile to use the node-gyp-build 4.8.1 version because it wouldn't use the new version automatically.

@SKT1yang
Copy link

SKT1yang commented Jul 5, 2024

I also found the same problem. I am developing a vue3 project, using vite:5.2.12, vite depends on ws:8.13.0, ws depends on utf-8-validate, using node version 18.17.0, pnpm install is normal, using 20.14.0 or 22.3.0, the installation of dependencies fails, and the running install script fails, that is, calling the node-gyp-build script fails

@AiHaibara
Copy link

I also found the same problem. I am developing a vue3 project, using vite:5.2.12, vite depends on ws:8.13.0, ws depends on utf-8-validate, using node version 18.17.0, pnpm install is normal, using 20.14.0 or 22.3.0, the installation of dependencies fails, and the running install script fails, that is, calling the node-gyp-build script fails

i also have the issue in 6.0.4 and succ in 6.0.3, it tips me missing tracker.exe for node-gyp-build.
how to solve this? should install the msvc 2022 build tools?

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

6 participants