首先配置了淘宝镜像源,去测试安装
但是报错: failed, reason: certificate has expired
证书过期
原因:淘宝镜像源改变
解决方式:更换淘宝镜像源
npm config set registry https://registry.npmmirror.com
清除npm缓存
npm cache clean --force
继续测试安装
报错: failed, reason: unable to get local issuer certificate
原因:无法获取本地颁发者证书,http请求https会报SSL的错误
取消ssl的校验
npm config set strict-ssl false
安装成功