1.查看当前镜像
npm config list
2.清空缓存
npm cache clean --force
3.修改镜像
npm config set registry https://registry.npmmirror.com
4.有的电脑可能之前用的淘宝镜像,改完后还是会显示certificate过期,这里可以试试,
npm config set strict-ssl false
记录一下,防止后续又出现该问题。解决方法来自博客:
原文链接:https://blog.csdn.net/maoge_666/article/details/136038003