I want to install the node package manager for my Twitter scraping application but I’m getting this error. I’ve tried several things like downgrading the Node version, disabling Windows Defender System, running PowerShell as an administrator, and so on.
Here’s the Error:
npm warn deprecated @types/[email protected]: This is a stub types definition. winston provides its own type definitions, so you do not need this installed.
npm warn deprecated @types/[email protected]: This is a stub types definition. helmet provides its own type definitions, so you do not need this installed.
npm warn deprecated [email protected]: 1.x is no longer supported. Please upgrade to 4.x or higher.
npm warn deprecated [email protected]: Critical security vulnerability fixed in v0.21.1. For more information, see https://github.com/axios/axios/pull/3410
npm error code 1
npm error path D:BotMesinTempurnode_modulesffi-napi
npm error command failed
npm error command C:WINDOWSsystem32cmd.exe /d /s /c node-gyp-build
npm error node:internal/child_process:414
npm error throw errnoException(err, 'spawn');
npm error ^
npm error
npm error Error: spawn EINVAL
npm error at ChildProcess.spawn (node:internal/child_process:414:11)
npm error at Object.spawn (node:child_process:761:9)
npm error at build (D:BotMesinTempurnode_modulesnode-gyp-buildbin.js:30:8)
npm error at preinstall (D:BotMesinTempurnode_modulesnode-gyp-buildbin.js:39:32)
npm error at D:BotMesinTempurnode_modulesnode-gyp-buildbin.js:11:7
npm error at ChildProcess.exithandler (node:child_process:430:5)
npm error at ChildProcess.emit (node:events:517:28)
npm error at maybeClose (node:internal/child_process:1098:16)
npm error at Socket.<anonymous> (node:internal/child_process:450:11)
npm error at Socket.emit (node:events:517:28) {
npm error errno: -4071,
npm error code: 'EINVAL',
npm error syscall: 'spawn'
npm error }
npm error
npm error Node.js v18.20.4
3
I think this issue related this Security Releases: https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2
You can downgrade to node 16 and install again to solve it.
2