profile
viewpoint

Ask questionsCannot install bcrypt

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 bcrypt@3.0.6 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:

bcrypt@3.0.6 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 bcrypt@3.0.6 and node@12.6.0 (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.<anonymous> (/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 BackEnd-angular8-material@1.0.0 No description npm WARN BackEnd-angular8-material@1.0.0 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

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

kelektiv/node.bcrypt.js

Answer questions recrsn

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

useful!
source:https://uonfu.com/
Github User Rank List