NPM无法安装某些软件包

时间:2019-11-29 13:59:33

标签: node.js npm

最近,我对Windows PC进行了重新格式化,安装了Atom和Node.js,并从安装软件包dualshock开始。我花一分钟时间,它失败并显示以下错误代码:

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Starb\node_modules\node-hid
gyp ERR! node -v v13.2.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN starb@1.0.0 No description
npm WARN starb@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-hid@0.5.7 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-hid@0.5.7 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Starb\AppData\Roaming\npm-cache\_logs\2019-11-29T13_46_21_869Z-debug.log

我尝试重新安装gyp,Node,清理缓存,以及您可能想像的所有内容。我到处搜寻Google,找不到任何有效的解决方案。

Full log from the console

1 个答案:

答案 0 :(得分:0)

如果使用Windows,则可能缺少Windows构建工具

npm install --global --production windows-build-tools

参考:https://github.com/nodejs/node-gyp