ERROR Failed to get response from https://registry.npm.taobao.org/ 错误的解决

这个问题最近才出现的。可能跟淘宝镜像的证书到期有关。

解决方式一:更新淘宝镜像(本人测试无效,但建议尝试)

虽然无效,但感觉是有很大关系的。还是设置一下比较好。
淘宝镜像的地址(registry.npm.taobao.org)在2024年1月22日居然到期了。新的地址为https://registry.npmmirror.com。
ERROR Failed to get response from https://registry.npm.taobao.org/ 错误的解决_第1张图片

更新npm镜像源

// 1. 清空缓存
npm cache clean --force

// 2. 切换新源
npm config set registry https://registry.npmmirror.com

// 3. 检测是否切换成功
npm config get registry

更新cnpm镜像源

不需要做更新,cnpm自己会维护。

解决方式二:别使用淘宝镜像切换为原始npm

在c:/User/xxx/.vuerc下面有一个.vuerc配置文件。将useTaobaoRegistry设置为false就可以禁用淘宝镜像。

  "useTaobaoRegistry": false,

这个文件本身是vue/cli生成的(猜测。。。)。
我是使用vue create xxx命令的时候才报这个错。vue这个命令只有你安装了vue/cli后才有这个命令。

vue create xxx

你可能感兴趣的:(npm,vue)