node.bcrypt.js: Failed at the bcrypt@1.0.2 install
-
What went wrong: Failed at the bcrypt@0.8.7 install script ‘node-gyp rebuild’.
-
What did you expect to happen: npm install bcrypt --g
-
Which version of nodejs: node@6.9.4 and OS: Windows 8
-
I get the follwoing error while installing ‘bcrypt’ $ npm install bcrypt --g
bcrypt@1.0.2 install C:\Users\MY\AppData\Roaming\npm\node_modules\bcrypt node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-win32-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.2 and node@6.9.4 (node-v48 ABI) (falling back to source compile with node-gyp)
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:\Users\MY\AppData\Roaming\npm\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 (C:\Users\MY\AppData\Roaming\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:215:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\MY\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js” “build” “–fallback-to-build” “–module=C:\Users\MY\AppData\Roaming\npm\node_modules\bcrypt\lib\binding\bcrypt_lib.node” “–module_name=bcrypt_lib” “–module_path=C:\Users\MY\AppData\Roaming\npm\node_modules\bcrypt\lib\binding”
gyp ERR! cwd C:\Users\MY\AppData\Roaming\npm\node_modules\bcrypt
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘C:\Program Files\nodejs\node.exe C:\Users\MY\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\MY\AppData\Roaming\npm\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\MY\AppData\Roaming\npm\node_modules\bcrypt\lib\binding’ (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\MY\AppData\Roaming\npm\node_modules\bcrypt\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:877:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
node-pre-gyp ERR! System Windows_NT 6.3.9600
node-pre-gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\MY\AppData\Roaming\npm\node_modules\bcrypt\node_modules\node-pre-gyp\bin\node-pre-gyp” “install” “–fallback-to-build”
node-pre-gyp ERR! cwd C:\Users\MY\AppData\Roaming\npm\node_modules\bcrypt
node-pre-gyp ERR! node -v v6.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute ‘C:\Program Files\nodejs\node.exe C:\Users\MY\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\MY\AppData\Roaming\npm\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\MY\AppData\Roaming\npm\node_modules\bcrypt\lib\binding’ (1)
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” “–g”
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! bcrypt@1.0.2 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@1.0.2 install script ‘node-pre-gyp install --fallback-to-build’.
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-pre-gyp install --fallback-to-build
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:\greenapp\next\rest\npm-debug.log
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 22
- Comments: 70
Commits related to this issue
- use bcryptjs until bcrypt can be installed on travis, see https://github.com/kelektiv/node.bcrypt.js/issues/476 — committed to HabitRPG/habitica by paglias 7 years ago
- Migrate to bcrypt (#8446) * start migrating to bcrypt * added method to convert the password to bcrypt when logging in, added method to compare password without knowing the hashing algorhytm, remo... — committed to HabitRPG/habitica by paglias 7 years ago
- Migrate to bcrypt (#8446) * start migrating to bcrypt * added method to convert the password to bcrypt when logging in, added method to compare password without knowing the hashing algorhytm, remo... — committed to phillipthelen/habitrpg by paglias 7 years ago
Please install compilers and pre-requisites for your systems.
Hi,
same problem on Ubuntu16.04 x64:
Thanks!
Hi,
I solved the problem,
But, There are some issues
Why?
Thanks!
bcrypt.js is very slow
help😨, we need fix🔥
Please fix the link.
ERROR: node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v51-linux-x64.tar.gz
Ubuntu 16.04 on DigitalOcean (512 MB / 1 CPU, 20 GB SSD)
The following worked for me:
Scale droplet up to the 1 GB RAM option
Run each of the following commands
Then try again with:
Scale droplet back down to the 512 MB option
: (
For anyone else who can’t get past this but needs bcrypt support, I switched to bcryptjs. API is the same, just a bit slower since it doesn’t use native bindings. Works good enough for me.
same here plz fix the link https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-linux-x64.tar.gz
We do have pre built binaries uploaded for macOS like it is available for 0.8.7. I’m working to automate the build uploading process and will hopefully be available soon.
Hi,
same problem on OSX:
$ npm i bcrypt --save
bcrypt@1.0.2 install /Users/antwal/Projects/db_replica/node_modules/bcrypt node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-darwin-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.2 and node@6.9.1 (node-v48 ABI) (falling back to source compile with node-gyp)
I’m also having this issue. Platform: Ubuntu 16.04.1 x64
Same problem! (Ubuntu 64)
The link https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-linux-x64.tar.gz what he try to download don’t exist.
Same here on Debian, but it’s not surprising because the following url is invalid: https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v51-linux-x64.tar.gz
@seonman See #470 If it’s an EC2, installing python and build-essentials (gcc, headers etc) before installing bcrypt.
Is there any workaround? I have to deploy Parse server to AWS and Azure, but I can’t because of this error.
Had the same problem on OS X. Solved by installing the command line tools in Xcode 😃
@anhquande ubuntu 12.04 is very old and does not contain a compliant g++ compiler (nodejs requires a c++11 compiler). You should install gcc-4.9 or higher
On Ubuntu 16.04 I did
sudo npm install bcrypt --saveinstead ofnpm install bcrypt --saveto make it works. This doesn’t work without sudo because I got this messagegyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.10.0"@antwal in this post you mentioned, “I have build it from source with node-pre-gyp”. Can you describe the steps you performed? I am having the same issue as @newdesignideas even after updating node, npm, node-pre-gyp, node-gyp, and the xcode command line tools.
Also, who can someone add the tarball file so that we avoid this portion of the error?
node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v51-darwin-x64.tar.gz[EDIT] It turns out that for me there was an issue with the folder version naming for node-gyp. In the .node-gyp folder (under /Users/YOURUSERNAME/.node-gyp) I renamed the 6.x folder to the version of node I’m using, which allowed the installation to succeed.
I’m also receiving this error when I attempt to deploy to heroku. I’m not sure how to fix this issue…
node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v48-linux-x64.tar.gz
For those on Ubuntu that are getting this sort of thing:
You likely just need build-essential:
sudo apt-get install build-essentialI have this same issue. The pre-built libraries link is incorrect forcing a fallback build that my system isn’t able to do. Current proper link would be, https://github.com/kelektiv/node.bcrypt.js/archive/v1.0.2.tar.gz as is stated in the package.json but apparently not in the npmjs registry?
Install this globally to make the node-red-admin command available on your path:
npm install -g node-red-admin
Note: you may need to run this with sudo, or from within an Administrator command
shell.
Then use
node-red-admin hash-pw
tool will prompt you for password:
password : abcd1234
$2a$08$ExBqI41sd5ythjkkkklref/6loiiAanRK.we8Zou0H3vMhUXiOfmq
@shivarajnaidu the solution is install build tools and latest version of nodejs
@devKC on heroku like on aws read the documentation for install build tools
@michelgokan I had the same problem on an older version of OSX; El Captian works smoothly; so I think installing everything functions properly even on Sierra
Windowsusers can try withnpm install --global --production windows-build-tools@seonman , For AWS Beanstalk or EC2, you need install gcc. headers, etc… For EC2 you can use SSH, for Beanstalk you can write a custom config for deploy, here doc