I opened a issue on this back in November of last year. Bcrypt wont install on Node 9.x.
There was a response of "binaries available" and the issue was closed.
What kind of sloppy project management is this? The issue is not resolved. Bcrypt still does not install on Node 9.
At this point, Bcrypt is the ONLY library blocking us from using Node 9+ and bcrypt is used in 4 lines of code.
We are now going to find an alternative to Bcrypt because clearly this project is poorly managed and 4 months later, we still can't use Node 9. Node will be at Node 10 and there will still be excuses as to why we can't use Node 9 & 10.
Why don't you try the built-in crypto module? Just a few lines, should be better. Don't let a single project block your work.
And by the way, you are free to open a PR, so you can help the community =)
Please attach error logs of why it isn't installing. We didn't have prebuilt binaries available back then, that was the most common cause of installation failures.
I and hundreds of others use bcrypt in Node 9, so there is something something wrong with your host. Without error logs, I can't say anything.
Had to downgrade bcyrpt from ^2.0.0 to ^1.0.3 as the latest isn't installing for me either.
On Windows, using latest stable version of node v8.11.1... tried installing node-gyp and following the set guide but it did not work for me.
Using C:\Users\Tyler\Documents\GitHub\tribot-api\package.json
[..................] - :
bcrypt ^1.0.3 → ^2.0.0
Run ncu with -u to upgrade package.json
PS C:\Users\Tyler\Documents\GitHub\tribot-api> npm i
> [email protected] install C:\Users\Tyler\Documents\GitHub\tribot-api\node_modules\bcrypt
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(302): https://github.com/kelektiv/node.bcrypt.js/releases/download/v2.0.0/bcrypt_lib-v2.0.0-node-v57-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI, unknown) (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.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SD
K or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\Tyler\Documents\GitHub\tribot-api\node_modules\bcrypt\build\bcrypt_lib.vcxpro
j]
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:\Users\Tyler\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Tyler\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\npm-lifecycle\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\Tyler\\Documents\\GitHub\\tribot-api\\node_modules\\bcrypt\\lib\\binding\\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\\Users\\Tyler\\Documents\\GitHub\\tribot-api\\node_modules\\bcrypt\\lib\\binding" "--napi_version=1" "--node_abi_napi=napi"
gyp ERR! cwd C:\Users\Tyler\Documents\GitHub\tribot-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\npm-lifecycle\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\Tyler\Documents\GitHub\tribot-api\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\Tyler\Documents\GitHub\tribot-api\node_modules\bcrypt\lib\binding --napi_version=1 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\Tyler\Documents\GitHub\tribot-api\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.16299
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Tyler\\Documents\\GitHub\\tribot-api\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\Tyler\Documents\GitHub\tribot-api\node_modules\bcrypt
node-pre-gyp ERR! node -v v8.11.1
node-pre-gyp ERR! node-pre-gyp -v v0.9.0
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\npm-lifecycle\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\Tyler\Documents\GitHub\tribot-api\node_modules\bcrypt\lib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\Tyler\Documents\GitHub\tribot-api\node_modules\bcrypt\lib\binding --napi_version=1 --node_abi_napi=napi' (1)
npm WARN @nestjs/[email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @nestjs/[email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @nestjs/[email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @nestjs/[email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I use Windows 10 x64 and bcrypt v2. You must run PowerShell as Administrator and:
npm --add-python-to-path install --global --production windows-build-tools
then
npm install -g node-gyp
It looks like its an issue with the upstream library node-pre-gyp which doesn't seem to handle 302 redirects. I will investigate and open an issue with them.
Confirmed that its an issue with node-pre-gyp
I also have the same issue
node-pre-gyp ERR! Tried to download(302): https://github.com/kelektiv/node.bcrypt.js/releases/download/v2.0.0/bcrypt_lib-v2.0.0-node-v59-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v59 ABI, unknown) (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.
blowfish.cc
bcrypt.cc
bcrypt_node.cc
win_delay_load_hook.cc
..\src\bcrypt_node.cc(83): warning C4244: 'argument': conversion from 'ssize_t' to 'unsigned char', possible loss of data [C:\Users\Mustafeez\Desktop\node\Se
ssionPra1\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
Creating library C:\Users\Mustafeez\Desktop\node\SessionPra1\node_modules\bcrypt\build\Release\bcrypt_lib.lib and object C:\Users\Mustafeez\Desktop\node
\SessionPra1\node_modules\bcrypt\build\Release\bcrypt_lib.exp
Generating code
All 342 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
Finished generating code
bcrypt_lib.vcxproj -> C:\Users\Mustafeez\Desktop\node\SessionPra1\node_modules\bcrypt\build\Release\bcrypt_lib.node
bcrypt_lib.vcxproj -> C:\Users\Mustafeez\Desktop\node\SessionPra1\node_modules\bcrypt\build\Release\bcrypt_lib.pdb (Full PDB)
Copying C:\Users\Mustafeez\Desktop\node\SessionPra1\node_modules\bcrypt\build\Release\/bcrypt_lib.node to C:/Users/Mustafeez/Desktop/node/SessionPra1/node_
modules/bcrypt/lib/binding\bcrypt_lib.node
1 file(s) copied.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
In order to use bcdypt, we've had to revert to 1.0.3 as 2.x.x wont install on Node 9 or 8.
node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(302): https://github.com/kelektiv/node.bcrypt.js/releases/download/v2.0.0/bcrypt_lib-v2.0.0-node-v57-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI, unknown) (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:\work\E1\Development
2.0\e1-admin-auth\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\Daniel's WorkstationAppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyplib\build.js:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Daniel's Workstation\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-to-build" "--module=C:\work\E1\Development 2.0\e1-admin-auth\node_modules\bcrypt\lib\binding\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\work\E1\Development 2.0\e1-admin-auth\node_modules\bcrypt\lib\binding" "--napi_version=1" "--node_abi_napi=napi"
gyp ERR! cwd C:\work\E1\Development 2.0\e1-admin-auth\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\Daniel's WorkstationAppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\work\E1\Development 2.0\e1-admin-auth\node_modules\bcryptlib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\work\E1\Development 2.0\e1-admin-auth\node_modules\bcryptlib\binding --napi_version=1 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess.
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.16299
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\work\E1\Development 2.0\e1-admin-auth\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\work\E1\Development 2.0\e1-admin-auth\node_modules\bcrypt
node-pre-gyp ERR! node -v v8.11.1
node-pre-gyp ERR! node-pre-gyp -v v0.9.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Daniel's WorkstationAppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\work\E1\Development 2.0\e1-admin-auth\node_modules\bcryptlib\binding\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\work\E1\Development 2.0\e1-admin-auth\node_modules\bcryptlib\binding --napi_version=1 --node_abi_napi=napi' (1)
npm WARN [email protected] requires a peer of graphql@>=0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of hapi@>=17.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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\Daniel's WorkstationAppData\Roaming\npm-cache_logs\2018-04-11T22_55_08_812Z-debug.log
Just reverted to 1.0.3 as well with a similar error using Meteor:
node-pre-gyp ERR! Tried to download(302): https://github.com/kelektiv/node.bcrypt.js/releases/download/v2.0.0/bcrypt_lib-v2.0.0-node-v57-linux-x64-glibc.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI, glibc) (falling back to source compile with node-gyp)
Hello, i have same issue on
Aws lightsail/ubuntu16.4/node 9.8.0
in the otherhand, windows10, which running node version 6.11.4 works fine.
log below
> [email protected] install /home/ubuntu/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/ubuntu/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/ubuntu/node_modules/bcrypt/lib/binding --napi_version=2 --node_abi_napi=napi' (1)
hope it fix soon.
This should be fixed with the latest release v2.0.1
@danielcasler You had the build dependencies missing. node-pre-gyp broke the download functionality we used to deliver the prebuilt modules. It is fixed in v2.0.1. There is usually a short delay between a release on npm and the availability of pre-built windows modules.
Trying to install bcrypt, latest version on Linux mint Sylvia... it doesn't work either
node-pre-gyp install --fallback-to-build
**node-pre-gyp ERR! Pre-built binaries not installable for [email protected] and [email protected]** (node-v59 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Hit error EACCES: permission denied, mkdir '/home/someroute/node_modules/bcrypt/lib'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/someroute/node_modules/bcrypt/build'
gyp ERR! System Linux 4.13.0-39-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/someroute/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/home/someroute/node_modules/bcrypt/lib/binding" "--napi_version=2" "--node_abi_napi=napi"
gyp ERR! cwd /home/someroute/node_modules/bcrypt
gyp ERR! node -v v9.10.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 '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/someroute/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/someroute/node_modules/bcrypt/lib/binding --napi_version=2 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/someroute/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:180:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:936:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Linux 4.13.0-39-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/someroute/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/someroute/node_modules/bcrypt
node-pre-gyp ERR! node -v v9.10.1
node-pre-gyp ERR! node-pre-gyp -v v0.9.1
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/someroute/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/someroute/node_modules/bcrypt/lib/binding --napi_version=2 --node_abi_napi=napi'(1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! /home/otherroute/.npm/_logs/2018-05-06T21_35_19_841Z-debug.log
So, what would be the solution for this?
@Mayocampo
permission denied, mkdir '/home/someroute/node_modules/bcrypt/build'
It seems you run rpm as root, therrfore your account cannot mkdir under /home/someroute/node_modules/
Check dir with ls -l /home/someroute/node_modules/
Im sure owner of upper dir is root. or your account cannot have permission.
I guess there are two options are available.
I decided first, and its fixed
I too am getting the same error. Please help.
It's not the same error. pre-built binaries are not available yet You should be able to make a source compile, check the README for instructions. It will be uploaded in 2 - 3 hours. There's usually a 12 - 15-hour delay between the release on npm and pre-built binaries
@manikmi Please open a new issue if installation still fails after installing compilers
Most helpful comment
This should be fixed with the latest release v2.0.1