npm install 失败,错误为 C2373,vs2015 更新 3 [英] npm install fails with error C2373 with vs2015 update 3

查看:87
本文介绍了npm install 失败,错误为 C2373,vs2015 更新 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Windows 10 重新安装我的机器后,使用 Visual Studio 2015 进行设置后,我在安装 git 存储库时遇到此错误:

After reinstalling my machine with windows 10, setting it up with Visual Studio 2015 I encountered this error on installing my git repositories:

npm install 在不同的项目上失败:

npm install fails on different projects with:

...
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: "__pfnDliNotifyHook2": [...]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.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:276:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 10.0.10586
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\...\node_modules\buffertools
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok

推荐答案

此错误与 npmnode-gypVisual Studio 2015<有关/code> 并且已经在 node-gyp@3.4.0 中修复,但是 npm 仍然指向旧版本.在我的解决方法中,我可以提出以下建议:

This error stays in relation with npm, node-gyp and Visual Studio 2015 and is already fixed in node-gyp@3.4.0, but npm is still pointing to an old version. As I workaround I can propose this:

  1. 转到安装 npm 的文件夹,例如:C:\Program Files\nodejs\node_modules\npm

打开:package.json

删除bundleDependencies

dependencies

在这个目录下制作一个npm i安装node-gyp@3.4.0解决问题

Make a npm i in this directory to install node-gyp@3.4.0 to fix the problem

相关的 GitHub 问题可以在这里找到:

Relating GitHub issues can be found here:

  1. nodejs/node#7286
  2. nodejs/node-gyp#956
  3. npm/npm#13199
  4. npm/npm#13200

这篇关于npm install 失败,错误为 C2373,vs2015 更新 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆