问题
使用npm时,报错certificate has expired解决方案
前提
首先我使用的是国内淘宝的镜像;切换镜像如下
// 查看当前使用的镜像
npm config get registry
// 切换为淘宝镜像
npm config set registry https://registry.npm.taobao.org
// 切换为官方镜像
npm config set registry https://registry.npmjs.org
报错原因
证书过期,无法使用
解决办法
取消ssl的校验
npm config set strict-ssl false
清除npm缓存
npm cache clean --force
然后重新执行npm install。