npm reason: certificate has expired

err
TS2307: Cannot find module 'vue' or its corresponding type declarations.

request to https://registry.npm.taobao.org/ant-design-vue failed, reason: certificate has expired

使用
npm i 命令 显示

image.png

报错
request to https://registry.npm.taobao.org/ant-design-vue failed, reason: certificate has expired

一、报错问题:提示淘宝镜像过期
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/ant-design-vue failed, reason: certificate has expired

二、错误提示已经告诉原因是淘宝镜像过期了!

、查看当前的npm镜像设置:npm config list

2、清空缓存:npm cache clean --force

3、然后修改镜像即可:npm config set registry https://registry.npmjs.org/ (或npm config delete registry)
npm config get registry https://registry.npmmirror.com/ 国内镜像源
4、再次运行: npm config list,查看 registry 已经被更改为默认的 npm 公共镜像地址。

5.运行 npm i


image.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容