node.bcrypt.js icon indicating copy to clipboard operation
node.bcrypt.js copied to clipboard

Cannot install bcrypt

Open zhnedyalkow opened this issue 7 years ago • 3 comments

Hi,

I am trying to install bcrypt using Nodejs v 12.6.0 and seems that they shall be compatible according to the documentation. Can someone help me to resolve the issue?

  • What went wrong? Cannot install [email protected] using Nodejs v12.6.0
  • What did you expect to happen? Install all required dependencies on newer nodejs version
  • Which version of nodejs and OS?
  • Nodejs v12.6.0 / node-gyp -v v3.8.0
  • System Linux 4.18.0-25-generic

Please refer to the output below:

[email protected] install /home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v72 ABI, glibc) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt/lib' gyp ERR! configure error gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt/build' gyp ERR! System Linux 4.18.0-25-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/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt/lib/binding" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72" gyp ERR! cwd /home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt gyp ERR! node -v v12.6.0 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 '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt/lib/binding --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1) node-pre-gyp ERR! stack at ChildProcess. (/home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:203:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) node-pre-gyp ERR! System Linux 4.18.0-25-generic node-pre-gyp ERR! command "/usr/local/bin/node" "/home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt node-pre-gyp ERR! node -v v12.6.0 node-pre-gyp ERR! node-pre-gyp -v v0.12.0 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/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt/lib/binding --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1) npm WARN [email protected] No description 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":"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/zoreshenski/.npm/_logs/2019-07-25T16_37_04_992Z-debug.log

Thank you in advance!

Br, Zhi

zhnedyalkow avatar Jul 25 '19 16:07 zhnedyalkow

EACCES: permission denied, mkdir '/home/zoreshenski/Desktop/Learning/Angular 8/FrontEnd-angular8-material/backend/node_modules/bcrypt/build’

Make sure to fix permissions along that path. Chown recursively. And do not run npm install as root

recrsn avatar Jul 26 '19 05:07 recrsn

Hi,

Thank you for your prompt response.

Everything is now working properly as suggested.

Please feel free to close this call.

Br, Zhi

zhnedyalkow avatar Jul 28 '19 14:07 zhnedyalkow

I am proceeding with case closure as the issue has been fixed by above recommendation.

zhnedyalkow avatar Aug 02 '19 06:08 zhnedyalkow