首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法运行npm install命令

无法运行npm install命令
EN

Stack Overflow用户
提问于 2020-10-06 17:47:16
回答 3查看 533关注 0票数 0

我是node的新手,我想运行这个项目:https://github.com/srtucker22/chatty

当我克隆并运行命令npm install时,我得到:

代码语言:javascript
复制
                         ~~~~~~~~~~~~~~~~~ ^
/Users/allstar/Library/Caches/node-gyp/14.13.0/include/node/v8.h:2810:3: note: 'ToString' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
  ^
/Users/allstar/Library/Caches/node-gyp/14.13.0/include/node/v8config.h:431:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/bcrypt_lib/src/bcrypt_node.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding" "--napi_version=7" "--node_abi_napi=napi"
gyp ERR! cwd /Users/allstar/dev/github/chatty/node_modules/bcrypt
gyp ERR! node -v v14.13.0
gyp ERR! node-gyp -v v5.1.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 build --fallback-to-build --module=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding --napi_version=7 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/allstar/dev/github/chatty/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1047:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Darwin 19.6.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/allstar/dev/github/chatty/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/allstar/dev/github/chatty/node_modules/bcrypt
node-pre-gyp ERR! node -v v14.13.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 build --fallback-to-build --module=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/Users/allstar/dev/github/chatty/node_modules/bcrypt/lib/binding --napi_version=7 --node_abi_napi=napi' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 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!     /Users/allstar/.npm/_logs/2020-10-06T09_37_52_418Z-debug.log

对哪里出了问题有什么可以帮助的吗?

mu当前版本为:

npm : 6.14.8

节点: v14.13.0

谢谢

EN

回答 3

Stack Overflow用户

发布于 2020-10-06 17:56:34

您是否尝试过使用稳定版本的node运行?如12.18.3

票数 0
EN

Stack Overflow用户

发布于 2020-10-06 18:03:16

这是一个与node-pre-gyp相关的错误。

尝试使用标志--build-from-resource执行npm install:

代码语言:javascript
复制
npm install --build-from-resource

https://github.com/nodejs/node-gyp/issues/1599

票数 0
EN

Stack Overflow用户

发布于 2020-10-06 18:03:53

请尝试以下步骤:

如果为present.

  • npm cache clean --force

  • npm install

,则

  1. 删除node_modules文件夹
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64223331

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档