Cannot 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 [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.
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
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
Hi,
Thank you for your prompt response.
Everything is now working properly as suggested.
Please feel free to close this call.
Br, Zhi
I am proceeding with case closure as the issue has been fixed by above recommendation.