abbr / deasync

Turns async function into sync via JavaScript wrapper of Node event loop
MIT License
971 stars 73 forks source link

Error: spawn EINVAL with Node.js v22.2.0 on Windows and pnpm 9.1.3 #189

Closed ylandau closed 5 months ago

ylandau commented 5 months ago

I encountered an issue with the deasync package when attempting to install it using Node.js v22.2.0 on Windows with pnpm 9.1.3. It works fine with Node.js v20.14.0 but fails with Node.js v22.2.0.

The installation fails with the following error:

pnpm i
Lockfile is up to date, resolution step is skipped
Packages: +24 -18
++++++++++++++++++++++++------------------
Progress: resolved 0, reused 38, downloaded 0, added 24, done
node_modules/deasync: Running install script, failed in 75ms
node_modules/deasync install$ node ./build.js
│ 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:760:9)
│     at build (node_modules/deasync/build.js:77:6)
│     at Object.<anonymous> (node_modules/deasync/build.js:69:5)
│     at Module._compile (node:internal/modules/cjs/loader:1434:14)
│     at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
│     at Module.load (node:internal/modules/cjs/loader:1249:32)
│     at Module._load (node:internal/modules/cjs/loader:1065:12)
│     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:12)
│     at node:internal/main/run_main_module:30:49 {
│   errno: -4071,
│   code: 'EINVAL',
│   syscall: 'spawn'
│ }
│ Node.js v22.2.0
└─ Failed in 75ms at node_modules/deasync
 ELIFECYCLE  Command failed with exit code 1.

Environment: Node.js version: v22.2.0 (Issue occurs) Node.js version: v20.14.0 (No issue) OS: Windows Package Manager: pnpm 9.1.3

Steps to Reproduce: Use Node.js v22.2.0 on a Windows machine. Run pnpm install in a project that includes deasync as a dependency. Delete the node_modules directory.

abbr commented 5 months ago

Error should be fixed in deasync@0.1.30