【已解决】npm ERR! request to https://registry.npm.taobao.org failed, reason: certificate has expired

有几个月没摸项目了,今天在新的机器上npm install遇到 npm ERR: request to https://registry.npm.taobao.org failed, reason: certificate has expired

翻译成中文就是:请求 https://registry.npm.taobao.org 失败,原因:证书已过期

省流助手: ` npm config set registry https://registry.npmjs.org/


问题由来

certificate has expired

其实熟悉 npm 国内镜像的开发者应该知道 淘宝 NPM 镜像站早就切换新域名老 npm.taobao.org 和 registry.npm.taobao.org 域名将于 2022 年 05 月 31 日零时起停止服务,而 npm.taobao.org 这个网站的证书已于 2024年01月22日过期了。这也就是为啥request to https://registry.npm.taobao.org failed, reason: certificate has expired
npm.taobao.org 的证书过期

解决方法

  • 使用正确的镜像源

npm config set registry https://registry.npmmirror.com

certificate has expired*
我们通过安装nrm工具之后,可以看到淘宝镜像是https://registry.npmmirror.com ,因此解决certificate has expired,只需配置正确的镜像地址即可~

评论 19
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值