第一步:更换镜像
npm config set registry https://registry.npmmirror.com
第二步:清理缓存
npm cache clean --force
第三步:查看是否生效
npm config get registry
第四步:正常使用npm install
淘宝镜像失效原因:淘宝原镜像域名(http://registry.npm.taobao.org)的 HTTPS 证书正式到期,导致旧的 npm 淘宝镜像在使用时出错
npm config set registry https://registry.npmmirror.com
npm cache clean --force
npm config get registry
淘宝镜像失效原因:淘宝原镜像域名(http://registry.npm.taobao.org)的 HTTPS 证书正式到期,导致旧的 npm 淘宝镜像在使用时出错