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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM