今天突然遇到一个报错,pnpm 报错:
ERR_PNPM_META_FETCH_FAIL GET https://registry.npm.taobao.org/@vue/cli-service: request to https://registry.npm.taobao.org/@vue/cli-service failed, reason: certificate has expired
问题原因:
之前设置的淘宝镜像,官方已经改了地址,不管install任何内容都会报错,只需要修改镜像源即可。
解决:
1.清理换缓存
npm cache clean --force
2.禁止安全连接
npm config set strict-ssl false
3.修改镜像源
npm config set registry https://registry.npmjs.org
npm config set registry https://registry.npmmirror.com
4.查看是否修改成功
npm config get registry
ok啦,大功告成了,接着去npm install吧。