簡體   English   中英

npm install bcrypt安裝失敗

[英]npm install bcrypt fails in install

我正在使用express js,並且想安裝bcrypt模塊進行數據身份驗證,但是一次又一次地收到此錯誤。

bcrypt@3.0.0安裝/ media / iron / 1d6c195f-2350-423c-a3f0-0500c92e580a / admin-template / vuely2 / Vuely / node_modules / bcrypt node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Pre-built binaries not installable for bcrypt@3.0.0 and node@9.11.0 (node-v59 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib' 
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/build'
gyp ERR! System Linux 4.4.0-134-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=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding" "--napi_version=3" "--node_abi_napi=napi"
gyp ERR! cwd /media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt
gyp ERR! node -v v9.11.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=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/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.4.0-134-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt
node-pre-gyp ERR! node -v v9.11.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.2
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=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/media/iron/1d6c195f-2350-423c-a3f0-0500c92e580a/admin-template/vuely2/Vuely/node_modules/bcrypt/lib/binding --napi_version=3 --node_abi_napi=napi' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bcrypt@3.0.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the bcrypt@3.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!     /home/iron/.npm/_logs/2018-08-30T06_44_17_236Z-debug.log

節點:v9.11.0

Npm:6.4.1

節點預gyp:0.11.0

在此問題中,您可以通過以下命令僅安裝bcrypt-nodejsbcryptjs而不是bcrypt

npm install --save bcrypt-nodejs && npm uninstall --save bcrypt

之后,只需在文件server.js中調用此方法,如下所示:

var bcryptNodejs = require('bcrypt-nodejs'); //Or bcryptjs

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM