nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.44k stars 276 forks source link

Error installing memoryjs, Error: spawn EINVAL #4373

Closed k-i-o closed 2 months ago

k-i-o commented 2 months ago

Details

Error installing memoryjs, first it installed fine, then I tried to install another library, it didn't work and now I can't download this one anymore

$ npm i    
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'E:\\Projects\\JSCheatsAssaultCube\\node_modules\\memoryjs\\node_modules',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'E:\Projects\JSCheatsAssaultCube\node_modules\memoryjs\node_modules\eslint\lib'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'E:\\Projects\\JSCheatsAssaultCube\\node_modules\\memoryjs\\node_modules\\eslint\\lib'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path E:\Projects\JSCheatsAssaultCube\node_modules\memoryjs
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npm run build
npm ERR! > memoryjs@3.5.1 build
npm ERR! > node ./scripts/install.js
npm ERR!
npm ERR! Node architecture is x64: running "npm.cmd run build64"
npm ERR! node:internal/child_process:421
npm ERR!     throw new ErrnoException(err, 'spawn');
npm ERR!     ^
npm ERR!
npm ERR! Error: spawn EINVAL
npm ERR!     at ChildProcess.spawn (node:internal/child_process:421:11)
npm ERR!     at spawn (node:child_process:761:9)
npm ERR!     at run (E:\Projects\JSCheatsAssaultCube\node_modules\memoryjs\scripts\install.js:18:17)
npm ERR!     at Object.<anonymous> (E:\Projects\JSCheatsAssaultCube\node_modules\memoryjs\scripts\install.js:31:3)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1368:14)
npm ERR!     at Module._extensions..js (node:internal/modules/cjs/loader:1426:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:1205:32)
npm ERR!     at Module._load (node:internal/modules/cjs/loader:1021:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12)
npm ERR!     at node:internal/main/run_main_module:28:49 {
npm ERR!   errno: -4071,
npm ERR!   code: 'EINVAL',
npm ERR!   syscall: 'spawn'
npm ERR! }
npm ERR!
npm ERR! Node.js v21.7.3

npm ERR! A complete log of this run can be found in: C:\Users\kio\AppData\Local\npm-cache\_logs\2024-04-16T21_49_28_053Z-debug-0.log

Node.js version

21.7.3

Example code

No response

Operating system

win11

Scope

installation

Module and version

Not applicable.

Danielv123 commented 2 months ago

This is an issue introduced with the latest patch release of node, see this CVE: https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2/

This needs to be resolved by a new memoryjs release. In the meantime you ca use --security-revert=CVE-2024-27980 to make the installer run as before.

k-i-o commented 2 months ago

maybe that was my problem idk, btw i tried more nodejs versions but nothing, i fixed just cloning the lib in my project as a my addon and built it manually. thx for sharing

Rob-- commented 1 month ago

Interesting... will release a fix

k-i-o commented 1 month ago

juicy