一、异常
C:\>npm install vue -g
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/vue failed, reason: certificate has expired
二、原因
请求 https://registry.npm.taobao.org 失败,证书已过期
三、解决
1、清空缓存
npm cache clean --force
2、查看当前的npm镜像设置
npm config get registry
3、切换新镜像源
npm config set registry https://registry.npmmirror.com
4、查看新源是否设置成功
npm config get registry
5、可以正常安装需要的工具了
npm install vue -g