gpt4 book ai didi

javascript - 无法安装 npm 软件包 - bcrypt@3.0.6 install : `node-pre-gyp install --fallback-to-build` in Ubuntu 18. 04

转载 作者:行者123 更新时间:2023-12-02 23:07:23 25 4
gpt4 key购买 nike

我正在尝试在 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++编译问题,但没有成功。

版本: Node :v10.16.0NPM: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

有人可以解释一下吗?

最佳答案

这是一个版本,并且错误消息中非常清楚地显示了访问问题。更改权限只是一步,但看起来您需要更新:

Node

吉普错误! Node -v v10.16.1
吉普 错误! Node gyp -v v3.8.0
吉普 错误!不行

以及由于某种原因您的系统 Linux 版本:吉普错误!系统Linux 5.0.0-25-generic

关于javascript - 无法安装 npm 软件包 - bcrypt@3.0.6 install : `node-pre-gyp install --fallback-to-build` in Ubuntu 18. 04,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57526187/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com