解决 binding.gyp not found (xxx/xxx/xxx) while trying to load binding.gyp 问题

1 篇文章 0 订阅
1 篇文章 0 订阅

在使用ccap图形验证码模块时遇到这个问题

Error: gyp failed with exit code: 1

于是我手动删了rm -rf ~/.node-gyp/ 目录下的文件重新执行了npm install node-gyp -g,但并没有解决问题,反而来了一个新问题
binding.gyp not found (xxx/xxx/xxx) while trying to load binding.gyp
这个就尴尬了,网上一番查找折腾,最终用如下方法解决问题

更新一下npm

sudo npm cache clean -f
sudo npm install npm -g

重新安装node-gyp 来替换node自带node-gyp

sudo npm uninstall node-gyp -g
sudo npm uninstall node-gyp
sudo npm install node-gyp -g 

然后就好了。

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值