node.bcrypt.js: bcrypt@3.0.0 fails to install

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Users\Tyler\Documents\GitHub\tribot-stats\api> npm i

> bcrypt@3.0.0 install C:\Users\Tyler\Documents\GitHub\tribot-stats\api\node_modules\bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.0/bcrypt_lib-v3.0.0-node-v57-win32-x64-unknown.tar.gz
node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.0 and node@8.11.1 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Users\Tyler\.windows-build-tools\python27\python.exe", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\Tyler\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Tyler\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Users\Tyler\AppData\Roaming\npm\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.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Tyler\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\Tyler\\Documents\\GitHub\\tribot-stats\\api\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\Users\\Tyler\\Documents\\GitHub\\tribot-stats\\api\\node_modules\\bcrypt\\lib\\binding" "--napi_version=1" "--node_abi_napi=napi" "--python=C:\\Users\\Tyler\\.windows-build-tools\\python27\\python.exe" "--msvs_version=2015"
gyp ERR! cwd C:\Users\Tyler\Documents\GitHub\tribot-stats\api\node_modules\bcrypt
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
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\Tyler\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Tyler\Documents\GitHub\tribot-stats\api\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\Tyler\Documents\GitHub\tribot-stats\api\node_modules\bcrypt\lib\binding --napi_version=1 --node_abi_napi=napi --python=C:\Users\Tyler\.windows-build-tools\python27\python.exe --msvs_version=2015' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\Tyler\Documents\GitHub\tribot-stats\api\node_modules\bcrypt\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Windows_NT 10.0.17134
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Tyler\\Documents\\GitHub\\tribot-stats\\api\\node_modules\\bcrypt\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\Tyler\Documents\GitHub\tribot-stats\api\node_modules\bcrypt
node-pre-gyp ERR! node -v v8.11.1
node-pre-gyp ERR! node-pre-gyp -v v0.10.2
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Tyler\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Tyler\Documents\GitHub\tribot-stats\api\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\Tyler\Documents\GitHub\tribot-stats\api\node_modules\bcrypt\lib\binding --napi_version=1 --node_abi_napi=napi --python=C:\Users\Tyler\.windows-build-tools\python27\python.exe --msvs_version=2015' (1)
npm WARN tslint@5.10.0 requires a peer of typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@2.26.2 requires a peer of typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 2.10.0-dev but none is installed. You must install peer dependencies yourself.
npm WARN tribot-api@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@3.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@3.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Tyler\AppData\Roaming\npm-cache\_logs\2018-07-09T16_01_22_764Z-debug.log
PS C:\Users\Tyler\Documents\GitHub\tribot-stats\api>

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 12
  • Comments: 36

Most upvoted comments

If you are using ubuntu, make sure you have the following packages installed: apt-get install -y build-essential

or CentOS: yum install gcc-c++ make

another… https://nodejs.org/en/download/package-manager/

npm install --save bcryptjs && npm uninstall --save bcrypt 😄

Same problem here, installing on linux

This worked for me…

  1. Make sure all nodejs programs are CLOSED
  2. Open console in administrator mode
  3. Install Yarn
  4. yarn add bcrypt@3.0.0

npm install --save bcrypt@3.0.6 --nodedir

@ihteshamqazi AFAIK:

bcrypt: is implemented in C++. Version 3+ doesn’t provide a pre-compiled version of it and therefore you need to have build tools installed to compile it. Although you don’t need them for deployment, you must ensure binary compatibility with your platform.

bcryptjs: is a plain js implementation and therefore you don’t need anything. But it’s around 30% slower, as stated in docs.

It’s up to you to use one of them. I use this one, because performance and security matters in this case.

Reverted to v2.0.1 for now. It would be good to get this issue solved as it’s been around for a while now and bcrypt is widely used.

Hey I think I ran into the same issue recently. If i understand the question you get that error when you try to run npm install bcrypt Well for me i tried npm install bcryptjs and it worked fine

npm install bcrypt@3.0.2

Pre-built binaries are now available for all supported platforms

node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp WARN Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v3.0.7/bcrypt_lib-v3.0.7-node-v64-win32-x64-unknown.tar.gz node-pre-gyp WARN Pre-built binaries not found for bcrypt@3.0.7 and node@10.15.1 (node-v64 ABI, unknown) (falling back to source compile with node-gyp) Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation Building the projects in this solution one at a time. To enable parallel build, please add the “/m” switch. MSBUILD : error MSB4132: The tools version “2.0” is unrecognized. Available tools versions are “4.0”. 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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:189:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Windows_NT 10.0.17763 gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “build” “–fallback-to-build” “–module=D:\VCN\port_server\node_modules\bcrypt\lib\binding\bcrypt_lib.node” “–module_name=bcrypt_lib” “–module_path=D:\VCN\port_server\node_modules\bcrypt\lib\binding” “–napi_version=3” “–node_abi_napi=napi” “–napi_build_version=0” “–node_napi_label=node-v64” gyp ERR! cwd D:\VCN\port_server\node_modules\bcrypt gyp ERR! node -v v10.15.1 gyp ERR! node-gyp -v v3.8.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:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=D:\VCN\port_server\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=D:\VCN\port_server\node_modules\bcrypt\lib\binding --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64’ (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (D:\VCN\port_server\node_modules\node-pre-gyp\lib\util\compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:189:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:970:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5) node-pre-gyp ERR! System Windows_NT 10.0.17763 node-pre-gyp ERR! command “C:\Program Files\nodejs\node.exe” “D:\VCN\port_server\node_modules\node-pre-gyp\bin\node-pre-gyp” “install” “–fallback-to-build” node-pre-gyp ERR! cwd D:\VCN\port_server\node_modules\bcrypt node-pre-gyp ERR! node -v v10.15.1 node-pre-gyp ERR! node-pre-gyp -v v0.13.0 node-pre-gyp ERR! not ok Failed to execute ‘C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=D:\VCN\port_server\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=D:\VCN\port_server\node_modules\bcrypt\lib\binding --napi_version=3 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64’ (1) npm WARN port_server@1.0.0 No description

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bcrypt@3.0.7 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bcrypt@3.0.7 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\SkilL\AppData\Roaming\npm-cache_logs\2019-11-27T04_37_12_792Z-debug.log

After installing python 2.7 😕 Why isn’t all the necessary stuff is provided or listed to be downloaded to use this goddamn library? That’s just too many dependencies out of the nodejs environment which is supported to be noted or informed.

npm i node -g or npm i node-linux-x64 -g workerd for me,

npm install --save bcryptjs && npm uninstall --save bcrypt 😄

Hi, can u please tell, whats the difference between bcrypt and bcryptjs.