Node-gyp: Error installing package with node-gyp (win_delay_load_hook.c?)

Created on 26 Aug 2016  ·  13Comments  ·  Source: nodejs/node-gyp

OS: Win 7
I have VS 2015 Community edition installed.

Node versions:
node: v6.4.0
npm: 3.10.3
node-gyp: v3.4.0

PS C:\Windows\system32> npm install truffle -g
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

[email protected] preinstall C:Users\EMU\AppData\Roaming\npm\node_modules.staging\scrypt-e061de67
node node-scrypt-preinstall.js

C:Users\EMU\AppData\Roaming\npm\truffle -> C:Users\EMU\AppData\Roaming\npm\node_modules\truffle\cli.js
C:Users\EMU\AppData\Roaming\npm\truffle-exec -> C:Users\EMU\AppData\Roaming\npm\node_modules\truffle\exec.js

[email protected] install C:Users\EMU\AppData\Roaming\npm\node_modules\truffle\node_modules\scrypt
node-gyp rebuild

C:Users\EMU\AppData\Roaming\npm\node_modules\truffle\node_modules\scrypt>if not defined npm_config_node_gyp (node "C:\P
rogram Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (nod
e "" rebuild )
Warning: Missing input files:
C:Users\EMU\AppData\Roaming\npm\node_modules\truffle\node_modules\scrypt\build..\scrypt\win\include\config.h
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Copying scrypt/win/include/config.h to scrypt/scrypt-1.2.0/config.h
The system cannot find the file specified.
win_delay_load_hook.c
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: '__pfnDliNot
ifyHook2': redefinition; different type modifiers [C:Users\EMU\AppData\Roaming\npm\node_modules\truffle\node_modules\s
crypt\build\copied_files.vcxproj]
E:\apps\Visual Studio 2015\VC\includedelayimp.h(134): note: see declaration of '__pfnDliNotifyHook2'
memlimit.c
keyderivation.c
pickparams.c
hash.c
win_delay_load_hook.c
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\src\win_delay_load_hook.c(34): error C2373: '__pfnDliNot
ifyHook2': redefinition; different type modifiers [C:Users\EMU\AppData\Roaming\npm\node_modules\truffle\node_modules\s
crypt\build\scrypt_wrapper.vcxproj]
E:\apps\Visual Studio 2015\VC\includedelayimp.h(134): note: see declaration of '__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:2
76:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 6.1.7601
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\EMU\AppData\Roaming\npm\node_modules\truffle\node_modules\scrypt
gyp ERR! node -v v6.4.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
C:Users\EMU\AppData\Roaming\npm
`-- (empty)

npm WARN optional Skipping failed optional dependency /truffle/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "ins
tall" "truffle" "-g"
npm ERR! node v6.4.0
npm ERR! npm v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the scrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs scrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls scrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log
npm ERR! code 1
PS C:\Windows\system32>

Most helpful comment

python -V gives me Python 2.7.11
But what helped was: npm config set python python2.7

All 13 comments

See the other issues about __pfnDliNotifyHook2. To summarize, upgrade to node-gyp v3.4.0.

I am using v3.4.0 I think

From the log you posted:

gyp ERR! node-gyp -v v3.3.1

Hmm could that be the version that comes with the npm package I am trying to install?
node-gyp -v says v3.4.0

Quite possible. Try upgrading to npm@latest.

I uninstalled nodejs and deleted the modules/other node/npm folders and reinstalled then updated npm.
It's working now, ty.

I was getting the same error. Upgraded from node-v6.6.0 to node-v6.8.1 and it worked.

Bug related to node-gyp is also mentioned been fixed on npm v3.10.5 release page

I cannot install it. Node v.6.9, node-gyp 3.4 & npm v3.10.8.

gyp ERR! UNCAUGHT EXCEPTION 
gyp ERR! stack Error: spawn EACCES
gyp ERR! stack     at exports._errnoException (util.js:1026:11)
gyp ERR! stack     at ChildProcess.spawn (internal/child_process.js:313:11)
gyp ERR! stack     at exports.spawn (child_process.js:380:9)
gyp ERR! stack     at exports.execFile (child_process.js:143:15)
gyp ERR! stack     at checkPythonVersion (/Users/MasterG/.nvm/versions/node/v6.9.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:419:5)
gyp ERR! stack     at /Users/MasterG/.nvm/versions/node/v6.9.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:361:9
gyp ERR! stack     at /Users/MasterG/.nvm/versions/node/v6.9.0/lib/node_modules/npm/node_modules/which/which.js:88:20
gyp ERR! stack     at /Users/MasterG/.nvm/versions/node/v6.9.0/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5
gyp ERR! stack     at /Users/MasterG/.nvm/versions/node/v6.9.0/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Darwin 16.0.0
gyp ERR! command "/Users/MasterG/.nvm/versions/node/v6.9.0/bin/node" "/Users/MasterG/.nvm/versions/node/v6.9.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/MasterG/.nvm/versions/node/v6.9.0/lib/node_modules/truffle/node_modules/scrypt
gyp ERR! node -v v6.9.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR!     <https://github.com/nodejs/node-gyp/issues>
/Users/MasterG/.nvm/versions/node/v6.9.0/lib
└── (empty)

npm ERR! Darwin 16.0.0
npm ERR! argv "/Users/MasterG/.nvm/versions/node/v6.9.0/bin/node" "/Users/MasterG/.nvm/versions/node/v6.9.0/bin/npm" "install" "-g" "truffle"
npm ERR! node v6.9.0
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 7
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the scrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs scrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls scrypt
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/MasterG/Projekte/ethereum-bet/npm-debug.log
npm ERR! code 1

@360disrupt That error probably means node-gyp couldn't find a working python binary. --verbose should tell you where it's looking. You can override it with --python /path/to/python.

python -V gives me Python 2.7.11
But what helped was: npm config set python python2.7

Good, that's basically the persistent version of --python.

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "f:\ProgramData\Anaconda3\python.EXE", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack at PythonFinder. (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack at D:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Projects\browser-solidity\node_modules\sha3
gyp ERR! node -v v8.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

@kenken64 I think you need to set f:\ProgramData\Anaconda3\python.EXE as python path in the environment variable

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zghbyslzf picture zghbyslzf  ·  3Comments

good-idea picture good-idea  ·  3Comments

Sentero-esp12 picture Sentero-esp12  ·  3Comments

kimown picture kimown  ·  3Comments

alexeyvo picture alexeyvo  ·  3Comments