今天npm执行报错
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/pnpm failed, reason: certificate has expired
npm ERR! A complete log of this run can be found in:
去查了很多资料,有的说清除缓存,有的说更新系统时间,有的说设置ssl失效,所有方法都尝试了就是无法解决,报错的信息也是换来换去,一个接一个。最后终于发现了原来是之前设置的淘宝镜像过期了,换一个镜像就可以了。
npm config set registry https://registry.npmmirror.com
最后执行验证操作,镜像与上面一致就可以了
npm config get registry