Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bcrypt still will not install on Node 9 #590

Closed
caesaneer opened this issue Apr 9, 2018 · 17 comments
Closed

Bcrypt still will not install on Node 9 #590

caesaneer opened this issue Apr 9, 2018 · 17 comments

Comments

@caesaneer
Copy link

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.

@samuelcecilio
Copy link

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 =)

@recrsn
Copy link
Collaborator

recrsn commented Apr 10, 2018

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.

@Tyler-V
Copy link

Tyler-V commented Apr 10, 2018

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

> bcrypt@2.0.0 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 bcrypt@2.0.0 and node@8.11.1 (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/common@4.6.6 requires a peer of reflect-metadata@0.1.10 but none is installed. You must install peer dependencies yourself.
npm WARN @nestjs/core@4.6.6 requires a peer of reflect-metadata@0.1.10 but none is installed. You must install peer dependencies yourself.
npm WARN @nestjs/microservices@4.6.6 requires a peer of reflect-metadata@0.1.10 but none is installed. You must install peer dependencies yourself.
npm WARN @nestjs/websockets@4.6.6 requires a peer of reflect-metadata@0.1.10 but none is installed. You must install peer dependencies yourself.
npm WARN tribot-api@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

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

@samuelcecilio
Copy link

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

@recrsn
Copy link
Collaborator

recrsn commented Apr 10, 2018

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.

@recrsn
Copy link
Collaborator

recrsn commented Apr 10, 2018

Confirmed that its an issue with node-pre-gyp

mapbox/node-pre-gyp#359

@MustafeezRehman
Copy link

MustafeezRehman commented Apr 10, 2018

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 bcrypt@2.0.0 and node@9.8.0 (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 sessionpra1@1.0.0 No description
npm WARN sessionpra1@1.0.0 No repository field.

@caesaneer
Copy link
Author

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 bcrypt@2.0.0 and node@8.11.1 (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 Workstation\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\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 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' (1)
node-pre-gyp ERR! stack at ChildProcess. (C:\work\E1\Development 2.0\e1-admin-auth\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:\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 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' (1)
npm WARN graphql-type-json@0.1.4 requires a peer of graphql@>=0.4.0 but none is installed. You must install peer dependencies yourself.
npm WARN inert@5.1.0 requires a peer of hapi@>=17.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN e1-admin-things@2.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@2.0.0 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@2.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\Daniel's Workstation\AppData\Roaming\npm-cache_logs\2018-04-11T22_55_08_812Z-debug.log

@Floriferous
Copy link

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 bcrypt@2.0.0 and node@8.9.3 (node-v57 ABI, glibc) (falling back to source compile with node-gyp) 

@juicycool92
Copy link

juicycool92 commented Apr 20, 2018

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

> bcrypt@2.0.0 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.

@recrsn
Copy link
Collaborator

recrsn commented Apr 21, 2018

This should be fixed with the latest release v2.0.1

@recrsn
Copy link
Collaborator

recrsn commented Apr 24, 2018

@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.

@recrsn recrsn closed this as completed Apr 24, 2018
@Mayocampo
Copy link

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 bcrypt@2.0.1 and node@9.10.1** (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: fsevents@1.2.0 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@2.0.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@2.0.1 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?

@juicycool92
Copy link

juicycool92 commented May 7, 2018

@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.

  1. Sudo rm -r /home/someroute/node_modules
    And install package via npm again, but withiut using sudo.
  2. Change mod ./node_module to access and excuteable.

I decided first, and its fixed

@manikmi
Copy link

manikmi commented Jul 7, 2018

I too am getting the same error. Please help.

@recrsn
Copy link
Collaborator

recrsn commented Jul 7, 2018

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

@recrsn
Copy link
Collaborator

recrsn commented Jul 7, 2018

@manikmi Please open a new issue if installation still fails after installing compilers

@kelektiv kelektiv locked as resolved and limited conversation to collaborators Jul 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants