我們在執行設置淘寶鏡像時突然報了
npm ERR! request to https://registry.npm.taobao.org/concurrently failed, reason: certificate has expired
原因: 淘寶鏡像原地址2024年1月22日已過期
image.png
解決:別擔心,我們只需要將命令替換成 下面鏡像即可解決
npm config set registry https://registry.npmmirror.com
或者可以換成其他鏡像也可以
npm 官方原始鏡像網址是:https://registry.npmjs.org/
淘寶最新 NPM 鏡像:https://registry.npmmirror.com
阿里云 NPM 鏡像:https://npm.aliyun.com
騰訊云 NPM 鏡像:https://mirrors.cloud.tencent.com/npm/
華為云 NPM 鏡像:https://mirrors.huaweicloud.com/repository/npm/
網易 NPM 鏡像:https://mirrors.163.com/npm/
中科院大學開源鏡像站:http://mirrors.ustc.edu.cn/
清華大學開源鏡像站:https://mirrors.tuna.tsinghua.edu.cn/
如果執行完后依舊是報同樣的報錯,請依次執行以下兩行命令
npm cache clean --force
npm config set strict-ssl false
有時候使用 npm cache clean --force 清除npm緩存的時候報錯Getting : npm WARN using --force Recommended protections disabled,此時可以嘗試使用以下命令
npm cache verify
然后再重新安裝
npm install