簡體   English   中英

無法安裝npm軟件包-bcrypt@3.0.6 install:在Ubuntu 18.04中`node-pre-gyp install --fallback-to-build`

[英]Couldn't install npm packages - bcrypt@3.0.6 install: `node-pre-gyp install --fallback-to-build` in Ubuntu 18.04

我正在嘗試在Ubuntu 18.04中npm安裝(注意:通過lerna bootstrap)一個項目。 我遇到一個錯誤(npm ERR!bcrypt@3.0.6 install: node-pre-gyp install --fallback-to-build ),無法前進。

我也嘗試安裝node-gyp,node-pre-gyp和apt-get build-essentials,相信這可能是因為C ++編譯問題,但是沒有運氣。

版本:節點:v10.16.0 NPM:6.9.0

ren@renish:~/Src/company$ sudo npm run bootstrap
npm WARN lifecycle The node binary used for scripts is /bin/node but npm is using /snap/node/2485/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> company@ bootstrap /home/ren/Src/company
> npm install && npx lerna bootstrap

npm WARN company@ No repository field.
npm WARN company@ No license field.

audited 43804 packages in 3.726s
found 41 high severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
lerna notice cli v3.15.0
lerna info Bootstrapping 7 packages
lerna info Installing external dependencies
lerna ERR! npm install exited 1 in 'company_api'
lerna ERR! npm install stdout:

> bcrypt@3.0.6 install /home/ren/Src/company/packages/api/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

Failed to execute '/snap/node/2485/bin/node /snap/node/2485/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/ren/Src/company/packages/api/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/ren/Src/company/packages/api/node_modules/bcrypt/lib/binding --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)

lerna ERR! npm install stderr:
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@10.16.1 (node-v64 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/home/ren/Src/company/packages/api/node_modules/bcrypt/lib' 
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/ren/Src/company/packages/api/node_modules/bcrypt/build'
gyp ERR! System Linux 5.0.0-25-generic
gyp ERR! command "/snap/node/2485/bin/node" "/snap/node/2485/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/ren/Src/company/packages/api/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/home/ren/Src/company/packages/api/node_modules/bcrypt/lib/binding" "--napi_version=4" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v64"
gyp ERR! cwd /home/ren/Src/company/packages/api/node_modules/bcrypt
gyp ERR! node -v v10.16.1
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 '/snap/node/2485/bin/node /snap/node/2485/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/ren/Src/company/packages/api/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/home/ren/Src/company/packages/api/node_modules/bcrypt/lib/binding --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/ren/Src/company/packages/api/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Linux 5.0.0-25-generic
node-pre-gyp ERR! command "/snap/node/2485/bin/node" "/home/ren/Src/company/packages/api/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/ren/Src/company/packages/api/node_modules/bcrypt
node-pre-gyp ERR! node -v v10.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok 
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/ren/.npm/_logs/2019-08-16T13_52_33_286Z-debug.log

lerna ERR! npm install exited 1 in 'company_api'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! company@ bootstrap: `npm install && npx lerna bootstrap`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the company@ bootstrap 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/ren/.npm/_logs/2019-08-16T13_52_33_951Z-debug.log

有人可以對此有所啟發嗎?

好吧,這是一個版本,錯誤消息中的訪問問題非常明顯。 更改權限是一個步驟,但是您似乎需要更新以下內容:

節點

gyp ERR! node -v v10.16.1 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok

以及由於某種原因您的系統linux版本: gyp ERR! System Linux 5.0.0-25-generic gyp ERR! System Linux 5.0.0-25-generic

暫無
暫無

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

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