yarn/npm certificate has expired

文章讲述了在使用yarn和npm进行包安装时遇到的HTTPS证书验证失败问题,提供了解决方案,包括检查可能影响HTTPS流量的网络安全软件,并设置strict-ssl选项为false作为临时措施。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

目录

报错

原因:HTTPS 证书过期

方法

a.检查网络安全软件:可能会拦截或修改 HTTPS 流量

b.淘宝镜像过期

c.镜像源不符合SSL安全套接协议

报错

info No lockfile found.
[1/4] Resolving packages...
error Error: certificate has expired
    at TLSSocket.onConnectSecure (node:_tls_wrap:1539:34)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket._finishInit (node:_tls_wrap:953:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:734:12)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

原因:HTTPS 证书过期

方法

a.检查网络安全软件:可能会拦截或修改 HTTPS 流量

b.淘宝镜像过期

第一步:清空缓存
npm cache clean --force

第二步:重新设置新的镜像源
npm config set registry https://registry.npmmirror.com

第三步:使用npm安装工具,没有再报错了
npm install

c.镜像源不符合SSL安全套接协议

strict-ssl:false关闭验证【临时方法】

yarn config set strict-ssl false

npm config set strict-ssl false

yarn 安装包时报“certificate has expired”_yarn certificate has expired-CSDN博客

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值