Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
159 views
in Technique[技术] by (71.8m points)

node.js - npm install fails with error C2373 with vs2015 update 3

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 fails on different projects with:

...
C:Program Files
odejs
ode_modules
pm
ode_modules
ode-gypsrcwin_delay_load_hook.c(34): error C2373: "__pfnDliNotifyHook2": [...]
gyp ERR! build error
gyp ERR! stack Error: `C:Program Files (x86)MSBuild14.0inmsbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:Program Files
odejs
ode_modules
pm
ode_modules
ode-gyplibuild.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...
ode_modulesuffertools
gyp ERR! node -v v4.4.7
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
question from:https://stackoverflow.com/questions/38149603/npm-install-fails-with-error-c2373-with-vs2015-update-3

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

  1. Go to your folder where npm is installed, e.g.: C:Program Files odejs ode_modules pm

  2. Open: package.json

  3. Remove entry for node-gyp in bundleDependencies

  4. Bump version number to 3.4.0 for node-gyp in dependencies

  5. Make a npm i in this directory to install [email protected] to fix the problem

Relating GitHub issues can be found here:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...