node gyp的问题

那年仲夏 提交于 2020-01-24 07:08:24

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

在使用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
1
2
重新安装node-gyp 来替换node自带node-gyp

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!