node.bcrypt.js: Can't build via npm: gyp failed with exit code 1
I am using
- Windows 8.1
- node v0.12.2
- npm 2.7.4
I was installing bcrypt via cmd (admin) and I got following errors.
gyp: binding.gyp not found (cwd: C:\Windows\system32\node_modules\bcrypt) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Windows\system32\node_modules\bcrypt
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bcrypt"
npm ERR! node v0.12.2
npm ERR! npm v2.7.4
npm ERR! code ELIFECYCLE
npm ERR! bcrypt@0.8.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.8.2 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bcrypt 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 their info via:
npm ERR! npm owner ls bcrypt
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
I also uses
- Visual Studio 2013
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 26 (1 by maintainers)
rm -rf ~/.node-gyp/ rm -r node_modules/.bin/; rm -r build/ npm install bcrypt
This was probably the most painful issue I’ve ever had to deal with…
Install Visual Studio Community 2013 (not 2015)…
NB - upgrading node is not a silver bullet. As you’ll likely run into issues where older repos require older dependencies forcing you to roll back / downgrade. With node version manager / nvm you can easily switch. Nvm use ‘1.0.0’
I had a similar issue when running npm update. The output had this in it as well.
I ran the command npm install node-sass now npm update and npm install work fine and I no longer get gyp ERR!
FWIW, I managed to get it to work in Ubuntu. Based on this line:
I went into the node-gyp config.js file and commented out line 316 //argv.push(‘–no-parallel’).
After doing that, it had no problem.
I should also note that you will need to run:
npm config set msvs_version 2013 --globalfor pc - you maybe able to use this @ying-yue https://github.com/coreybutler/nvm-windows otherwise just upgrade node you seem to be using node -v v7.10.0 upgrade it - and problem will be solved.