繁体   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