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