共计 582 个字符,预计需要花费 2 分钟才能阅读完成。
npm 报错 error An unexpected error occurred: “https://registry.npm.taobao.org/xxx: certificate has expired”.
- 报错原因
- 解决方法
- 其他包管理器
报错原因
是由于我们的 npm 镜像仓库配置的淘宝镜像失效了,可以使用 npm config list
来查看一下镜像仓库的配置。
npm config list
比如我的是:
可以看到我的是已经失效了的
解决方法
npm config set registry https://registry.npmmirror.com
再次运行 npm i 下载包就可以了
其他包管理器
如果你使用的是 yarn 或者 pnpm,那么在更改 yarn 和 pnpm 镜像源无效后,还要检查 npm 镜像源是否失效,我之前就是更改 yarn 后没效果,需要把 npm 的镜像源也改才可以。'yarn 切换镜像源'
yarn config set registry https://registry.npmmirror.com
'pnpm 切换镜像源'
pnpm config set registry https://registry.npmmirror.com
原文地址: npm 报错 error An unexpected error occurred:“https://registry.npm.taobao.org/ai.touchui-vue: certific
正文完