npm ERR! request to https://registry.npmjs.org/vue-resource failed, reason: self signed certificate in certificate chain

在Docker的Dockerfile中执行npm install时报错,如下:

Step 4/7 : RUN npm install
 ---> Running in 7ba60e3eab62
npm ERR! code SELF_SIGNED_CERT_IN_CHAIN
npm ERR! errno SELF_SIGNED_CERT_IN_CHAIN
npm ERR! request to https://registry.npmjs.org/vue-resource failed, reason: self signed certificate in certificate chain

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-07-21T08_39_47_777Z-debug.log

原因

电脑使用Charles绑了代理,导致npm安装时出错。


解决方法

关掉电脑代理。


参考文章:

https://github.com/npm/npm/issues/6916

npm ERR! request to https://registry.npmjs.org/vue-resource failed, reason: self signed certificate in certificate chain

上一篇:Winter-1-E Let the Balloon Rise 解题报告及测试数据


下一篇:h5分享功能[通过复制网页链接分享]