node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node

npm install 安装依赖包报如下错误

gyp ERR! cwd /Users/waterw/git/2019/ipfs/orbit-web/node_modules/gc-stats
gyp ERR! node -v v6.0.0
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 '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/waterw/git/2019/ipfs/orbit-web/node_modules/gc-stats/build/gcstats/v1.2.1/Release/node-v48-darwin-x64/gcstats.node --module_name=gcstats --module_path=/Users/waterw/git/2019/ipfs/orbit-web/node_modules/gc-stats/build/gcstats/v1.2.1/Release/node-v48-darwin-x64 --node_abi_napi=node-v48 --napi_build_version=0 --node_napi_label=node-v48' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/waterw/git/2019/ipfs/orbit-web/node_modules/gc-stats/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:106:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:850:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
node-pre-gyp ERR! System Darwin 17.7.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/waterw/git/2019/ipfs/orbit-web/node_modules/gc-stats/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/waterw/git/2019/ipfs/orbit-web/node_modules/gc-stats
node-pre-gyp ERR! node -v v6.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
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 configure --fallback-to-build --module=/Users/waterw/git/2019/ipfs/orbit-web/node_modules/gc-stats/build/gcstats/v1.2.1/Release/node-v48-darwin-x64/gcstats.node --module_name=gcstats --module_path=/Users/waterw/git/2019/ipfs/orbit-web/node_modules/gc-stats/build/gcstats/v1.2.1/Release/node-v48-darwin-x64 --node_abi_napi=node-v48 --napi_build_version=0 --node_napi_label=node-v48' (1)

解决方法

Mac升级到High sierra 后,发现执行使用npm 或者yarn 的时候,不时会报gyp: No Xcode or CLT version detected! 的错误, 原因是缺了xcode 的CLI 工具, 只要执行下面的命令来安装就可以了。

sudo xcode-select --install
 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

未来AI编程

共鸣===鼓励 打赏您随意

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值