vue3项目yarn install遇到的info There appears to be trouble with your network connection.Retrying.·. 问题解决

新接手的vue3项目在安装依赖的时候经常下载失败,报错Couldn't find package ... on the "npm" registry 或者 error Error:read ECONNRESET
image

1. 可以改变当前的源

查看当前使用的源 yarn config get registry
改变源 yarn config set registry https://registry.npmmirror.com(推荐)
或 yarn config set registry https://registry.npm.taobao.org

2. 在.npmrc文件中添加配置

如果换源不能奏效,可以看下项目目录中是否有.npmrc这个文件
有的话要添加registry=https://registry.npmmirror.com这样一行

image

参考链接

https://www.cnblogs.com/caihongmin/p/18075763
https://www.cnblogs.com/qubernet/p/17900506.html

posted @ 2025-01-08 15:02  卡利的亲爹  阅读(261)  评论(0)    收藏  举报