npm 安裝插件報錯如下:
npm ERR!request to https://registry.npm.taobao.org/...reason:certificate has expired
問題浮現原因:
原來設置淘寶鏡像,官方已經修改了地址,導致不管下載什么組件都會報錯
解決步驟1:將npm的下載源恢復成默認的官方源
npm config set registry https://registry.npmjs.org
解決步驟2:最新的配置淘寶鏡像的淘寶官方提供的方法:
npm config set registry https://registry.npmmirror.com
解決步驟3:查看是否修改成功
npm config get registry
完成!
如果執行npm install 還是報錯
執行以下命令:
清空緩存:
npm cache clean --force
禁止SSL/TLS安全連接
npm config set strict-ssl false