修复yarn安装依赖包报错errorAnunexpectederroroccurred:https://registry.npm.taobao.orgnpm/element-ui:get问题

作者:袖梨 2026-06-08

yarn安装依赖包报错

error An unexpected error occurred: “https://registry.npm.taobao.orgnpm/element-ui: getaddrinfo ENOTFOUND registry.npm.taobao.orgnpm registry.npm.taobao.orgnpm:443”.

解决yarn安装依赖包报错errorAnunexpectederroroccurred:https://registry.npm.taobao.orgnpm/element-ui:get问题

这是因为网络不好导致的下载依赖包请求超时报错,更改下载地址即可。

解决

步骤1

请求地址设置成淘宝源

解决yarn安装依赖包报错errorAnunexpectederroroccurred:https://registry.npm.taobao.orgnpm/element-ui:get问题

npm config set registry https://registry.npm.taobao.org  npm config set disturl https://npm.taobao.org/dist  

步骤2

对node-sass镜像源进行设置

解决yarn安装依赖包报错errorAnunexpectederroroccurred:https://registry.npm.taobao.orgnpm/element-ui:get问题

yarn config set sass-binary-site http://npm.taobao.org/mirrors/node-sass

步骤3

重新下载

解决yarn安装依赖包报错errorAnunexpectederroroccurred:https://registry.npm.taobao.orgnpm/element-ui:get问题

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持本站。

相关文章

精彩推荐