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\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
Or update npm:
An alternative solution that doesn't involve messing with
npm
installation is to runbefore running
npm install
This error stays in relation with
npm
,node-gyp
andVisual Studio 2015
and is already fixed innode-gyp@3.4.0
, butnpm
is still pointing to an old version. As I workaround I can propose this:Go to your folder where npm is installed, e.g.:
C:\Program Files\nodejs\node_modules\npm
Open:
package.json
Remove entry for
node-gyp
inbundleDependencies
Bump version number to
3.4.0
fornode-gyp
independencies
Make a
npm i
in this directory to installnode-gyp@3.4.0
to fix the problemRelating
GitHub
issues can be found here: