共计 496 个字符,预计需要花费 2 分钟才能阅读完成。
使用 vue 开发项目时,安装插件一直安装不上,安装依赖报错。
报错信息:npm ERR! request to https://registry.npm.taobao.org/vue-pdf failed,
reason: certificate has expired
翻译成中文就是:
请求 https://registry.npm.taobao.org 失败,
原因:证书已过期
从报错信息可看出,以前经常使用的淘宝镜像 htps:/registr.npm.taobao.org! 的证书过期了,就是该域名的备案证书过期了,既然淘宝已经换了新域名,那就将原先配置的 npm 镜像源更改就好了。
1. 查看当前 npm 镜像
npm config get
2. 配置新的镜像
npm config set registry https://registry.npmmirror.com
3. 再次查看镜像配置情况
npm config get4. 重新启动项目
npm run dev
原文地址: (已解决)npm ERR! request to https://registry.npm.taobao.org/xxx failed, reason: certificate has expired
正文完