npm淘宝镜像报错 reason: certificate has expired证书过期问题解决

我们在执行设置淘宝镜像时突然报了
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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容