kelektiv / node.bcrypt.js

bcrypt for NodeJs
MIT License
7.43k stars 510 forks source link

Unable to install #893

Closed Codeveen closed 1 year ago

Codeveen commented 2 years ago

I'm unable to install bcrypt on my laptop. I recently upgraded my OS to windows 11 beta version. But I'm not sure if that actually affects the installation. I'm pasting the error I got on my command line. I guess I might have to update my VS CODE?

node-pre-gyp ERR! install response status 403 Forbidden on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-win32-x64-unknown.tar.gz node-pre-gyp WARN Pre-built binaries not installable for bcrypt@5.0.1 and node@14.17.3 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error response status 403 Forbidden on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-win32-x64-unknown.tar.gz gyp ERR! find VS gyp ERR! find VS msvs_version not set from command line or npm config gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer gyp ERR! find VS looking for Visual Studio 2015 gyp ERR! find VS - not found gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 gyp ERR! find VS gyp ERR! find VS ** gyp ERR! find VS You need to install the latest version of Visual Studio gyp ERR! find VS including the "Desktop development with C++" workload. gyp ERR! find VS For more information consult the documentation at: gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows gyp ERR! find VS ** gyp ERR! find VS gyp ERR! configure error gyp ERR! stack Error: Could not find any Visual Studio installation to use gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16 gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14) gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14 gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16 gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7 gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16 gyp ERR! stack at ChildProcess.exithandler (child_process.js:326:5) gyp ERR! stack at ChildProcess.emit (events.js:375:28) gyp ERR! stack at maybeClose (internal/child_process.js:1055:16) gyp ERR! System Windows_NT 10.0.22000 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\prave\OneDrive\desktop\code-share-API\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=C:\Users\prave\OneDrive\desktop\code-share-API\node_modules\bcrypt\lib\binding\napi-v3" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3" gyp ERR! cwd C:\Users\prave\OneDrive\desktop\code-share-API\node_modules\bcrypt gyp ERR! node -v v14.17.3 gyp ERR! node-gyp -v v5.1.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 configure --fallback-to-build --module=C:\Users\prave\OneDrive\desktop\code-share-API\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\prave\OneDrive\desktop\code-share-API\node_modules\bcrypt\lib\binding\napi-v3 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1) node-pre-gyp ERR! stack at ChildProcess. (C:\Users\prave\OneDrive\Desktop\code-share-API\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:375:28) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1055:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) node-pre-gyp ERR! System Windows_NT 10.0.22000 node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\prave\OneDrive\Desktop\code-share-API\node_modules\@mapbox\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd C:\Users\prave\OneDrive\desktop\code-share-API\node_modules\bcrypt node-pre-gyp ERR! node -v v14.17.3 node-pre-gyp ERR! node-pre-gyp -v v1.0.5 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 configure --fallback-to-build --module=C:\Users\prave\OneDrive\desktop\code-share-API\node_modules\bcrypt\lib\binding\napi-v3\bcrypt_lib.node --module_name=bcrypt_lib --module_path=C:\Users\prave\OneDrive\desktop\code-share-API\node_modules\bcrypt\lib\binding\napi-v3 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1) npm WARN code-share-API@1.0.0 No description npm WARN code-share-API@1.0.0 No repository field.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bcrypt@5.0.1 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bcrypt@5.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! C:\Users\prave\AppData\Roaming\npm-cache_logs\2021-09-20T22_59_03_931Z-debug.log

iago-srm commented 2 years ago

Getting the same error here.

Codeveen commented 2 years ago

Getting the same error here.

did you recently update your OS to Windows 11 beta version?

alexcyfong commented 2 years ago

npm install bcrypt failed on a fresh build. ( npm init , then npm install bcrypt)

PS C:\code\bcrypt> npm install bcrypt npm ERR! code 1 npm ERR! path C:\code\bcrypt\node_modules\bcrypt npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build

npm version 7.24.0, node version V.14.17.6 (LTS version)

jrmcpeek commented 2 years ago

We're encountering this same issue for Linux machines as well with node 14.x and bcrypt 5.0.1.

Wasn't happening last week, and nothing has changed configuration wise on our end. Even historical builds now fail.

chetan-2002 commented 2 years ago

I am also facing the same issue.

chunfat-setsail commented 2 years ago

https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.0/bcrypt_lib-v5.0.0-napi-v3-linux-x64-musl.tar.gz

same here, but v5.0.0, SignatureDoesNotMatch?

d0v3riz commented 2 years ago

Same here, any other solution?

chunfat-setsail commented 2 years ago

https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.0/bcrypt_lib-v5.0.0-napi-v3-linux-x64-musl.tar.gz

same here, but v5.0.0, SignatureDoesNotMatch?

seems it is fixed

bengouss commented 2 years ago

Same issue 😞

gompa commented 2 years ago

you can probably fix it by installing the build dependencys if you need to deploy right now. if you are running docker you can fix it by installing the none slim version of the node container (this includes python) and it will build it from source but i think something is wrong with the automated builds or atleast acces to them :

npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-linux-x64-glibc.tar.gz
npm ERR! node-pre-gyp ERR! install response status 403 Forbidden on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-linux-x64-glibc.tar.gz

but downloading it by hand works,

bengouss commented 2 years ago

you can probably fix it by installing the build dependencys if you need to deploy right now. if you are running docker you can fix it by installing the none slim version of the node container (this includes python) and it will build it from source but i think something is wrong with the automated builds or atleast acces to them :

npm ERR! node-pre-gyp http GET https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-linux-x64-glibc.tar.gz
npm ERR! node-pre-gyp ERR! install response status 403 Forbidden on https://github.com/kelektiv/node.bcrypt.js/releases/download/v5.0.1/bcrypt_lib-v5.0.1-napi-v3-linux-x64-glibc.tar.gz

but downloading it by hand works,

Is is possible to manually download that file and put it in the right folder to be used at install, instead of adding all the necessary dependencies to build from source ?

sam3d commented 2 years ago

I've been able to get this to work for the moment by downgrading to 5.0.0

sam3d commented 2 years ago

It's now working for me again, @Codeveen what happens when you try now?

bengouss commented 2 years ago

It was related to a bug with node-fetch used by node-pre-gyp. All solved now

paul8989 commented 2 years ago

Had same issue today in Win 10 - while using npm i bcrypt butnpm i bcrypt@5.0.0 worked as suggested by @sam3d

LAICHEEHOONG commented 2 years ago

downgrade node version to 14.18.3 can fix the install error

georgehester commented 2 years ago

Fixed this issue on ubuntu 20.04.2 LTS by updating the node version to 18.x.x through nvm (also good practice to update the default alias with nvm for node-gyp nvm alias default 18), after that node-gyp ran fine, was also running node 14.x.x when I was previously getting the error.