Bcrypt error while installing on mac elcapitan. npm-debug log added to issue.
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save-dev"
npm ERR! node v6.3.1
npm ERR! npm v3.10.3
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 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 information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output abov
npm-debug.log.tar.gz
e.
Have the same issue on Windoze 10
c:\Build\nodejs\test>npm install bcrypt
[email protected] install c:\Build\nodejs\test\node_modules\bcrypt
node-gyp rebuild
c:\Build\nodejs\test\node_modules\bcrypt>if not defined npm_config_node_gyp (node "G:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (G:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:401:14)
gyp ERR! stack at G:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:356:11
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:117:15)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "G:\Program Files\nodejs\node.exe" "G:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Build\nodejs\test\node_modules\bcrypt
gyp ERR! node -v v6.2.2
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "G:\Program Files\nodejs\node.exe" "G:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "bcrypt"
npm ERR! node v6.2.2
npm ERR! npm v3.9.5
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 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 information on how to open an issue for this project with:
npm ERR! npm bugs bcrypt
npm ERR! Or if that isn't available, 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:\Build\nodejs\test\npm-debug.log
npm-debug.log.zip
@rwdietrich your log includes the error that you're missing python:
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
@satishweb you might be short of a dependency too. I stumbled upon this list of required packages https://gist.github.com/rakam/b851c02589c3467982b0 which helped me resolve the problem on alpine
@masone Thanks for the comment. I noticed python missing as well, but it seems like it should have been installed as a dependency. I tried "npm install python" but got the same results for bcrypt.
Python is a system level dependency, not a missing npm package. https://www.python.org/downloads/
Grumble, grumble. Still a dependency. Anyway, I installed 3.5 and then found I needed 2.7. Then tried pointing PYTHON env variable to the executable and got:
`c:\Build\nodejs\test>npm install bcrypt
[email protected] install c:\Build\nodejs\test\node_modules\bcrypt
node-gyp rebuild
c:\Build\nodejs\test\node_modules\bcrypt>if not defined npm_config_node_gyp (node "G:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual
Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [c:\Build\nodejs\test\node_modules\bcrypt\build\binding.
sln]
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (G:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276: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 10.0.10586
gyp ERR! command "G:\Program Files\nodejs\node.exe" "G:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Build\nodejs\test\node_modules\bcrypt
gyp ERR! node -v v6.2.2
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok`
So I guess I need to find the VC++ components now. All this is a painful departure from trying to get the original task done.
Same issue as OP here. I've searched around and this seems to be a common occurrence for windows users, but I am on a mac.
Guess I don't understand why an issue that hasn't been resolved is closed with no comments. Does the closer simply want to avoid fixing an issue on Windows?
Judging by the comment above by @masone and the fact that the project readme states a dependency on Python 2.x, I believe the solution is to ensure Python is installed on the system.
Installing Python before installing bcrypt resolved this issue for me when installing in a container based on the debian:jesse Dockerimage:
sudo apt-get update && sudo apt-get install -y build-essential python
@jonatanblue, I appreciate your willingness to comment, but read a bit more closely. Python 2.7 was installed, and more importantly, it was a problem on Windoze. Your example uses sudo and apt-get, not available in that environment.
Most helpful comment
Guess I don't understand why an issue that hasn't been resolved is closed with no comments. Does the closer simply want to avoid fixing an issue on Windows?