我在尝试使用Node.js版本14安装bcrypt.js包时遇到问题

pkln4tw6  于 5个月前  发布在  Node.js
关注(0)|答案(1)|浏览(94)

当我尝试安装bcrypt版本5或更低版本时,它不会安装Node.js版本14。它显示这样的错误:

node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v64 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error ENOENT: no such file or directory, mkdir
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '//node_modules/bcrypt/build'
gyp ERR! System Linux 5.4.0-56-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "configure" "--fallback-to-build" "--module=//node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=//node_modules/bcrypt/lib/binding/napi-v3" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd //node_modules/bcrypt
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/bin/node-gyp configure --fallback-to-build --module=//node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=//node_modules/bcrypt/lib/binding/napi-v3 --napi_version=5 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack at ChildProcess.cmd.on (//node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
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.4.0-56-generic
node-pre-gyp ERR! command "/usr/bin/node" "//node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd //node_modules/bcrypt
node-pre-gyp ERR! node -v v10.19.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.11
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /usr/bin/node-gyp configure --fallback-to-build --module=//node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=//node_modules/bcrypt/lib/binding/napi-v3 --napi_version=5 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

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! /root/.npm/_logs/2024-01-02T08_19_53_217Z-debug.log

字符串

q5iwbnjs

q5iwbnjs1#

试着跑
npm install --global --production windows-build-tools用于Windows
sudo apt-get install -y build-essential python for Ubuntu
也试着阅读https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions

相关问题