转自 yarn install 报错: info There appears to be trouble with your network connection. Retrying... - 简书
第一步:网络连接似乎出了点问题,请重试... 但仔细检查下来,网络并没有什么问题?
第二步:网络一切正常,那么问题就很可能出现在了代理连接上。
第三步:没查到原因那就,重新配置:详见解决方案。
解决方案:
更换安装依赖的镜像,使用2024年后新的淘宝镜像安装,代码如下:
1、安装好后更换淘宝镜像
yarn config set registry https://registry.npmmirror.com/
2、移除原代理
yarn config delete proxy
npm config rm proxy
npm config rm https-proxy
3、安装cnpm镜像并使用代理registry
#安装cnpm镜像
npm install -g cnpm --registry=https://registry.npmmirror.com/
#使用代理registry
npm config set registry https://registry.npmmirror.com/
4、npm install
或者 yarn install
如果还不能安装,就把 yarn-lock 删除