如何解决nodejs中spawn einval错误

问题描述 投票:0回答:1

我想为我的 Twitter 抓取应用程序安装节点包管理器,但收到此错误。我尝试过多种方法,例如降级 Node 版本、禁用 Windows Defender 系统、以管理员身份运行 PowerShell 等等。

这是错误:

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:\Bot\MesinTempur\node_modules\ffi-napi
npm error command failed
npm error command C:\WINDOWS\system32\cmd.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:\Bot\MesinTempur\node_modules\node-gyp-build\bin.js:30:8)
npm error     at preinstall (D:\Bot\MesinTempur\node_modules\node-gyp-build\bin.js:39:32)
npm error     at D:\Bot\MesinTempur\node_modules\node-gyp-build\bin.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
node.js typescript visual-studio-code node-modules
1个回答
-1
投票

我认为这个问题与此安全版本相关:https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2

可以降级到node 16,重新安装即可解决。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.