前端[yarnpkg/yarn] There appears to be trouble with your network connection.
近日,我安装完React-Native环境之后,惊讶的发现,yarn用不了了,不知道是安装了RN环境的问题,还是别的问题,yarn也重装了,但是依然没有解决问题。下面放几个解决问题的方法:
![前端[yarnpkg/yarn] There appears to be trouble with your network connection.](https://www.huanggr.cn/wp-content/uploads/2020/04/74115b4a8959fd3375a087dc7690f4d3.png)
方法一:前端[yarnpkg/yarn] There appears to be trouble with your network connection.
1 | yarn install --network-timeout 1000000 //我试了无效 |
方法二:
1、安装好后更换淘宝镜像
1 2 3 4 | yarn config set registry https://registry.npm.taobao.org yarn config delete proxy npm config rm proxy npm config rm https-proxy |
npm 超时
安装cnpm镜像
1 | npm install -g cnpm --registry=https://registry.npm.taobao.org |
使用代理registry
1 | npm config set registry https://registry.npm.taobao.org |
方法三:前端[yarnpkg/yarn] There appears to be trouble with your network connection.
使用npm或cnpm
![前端[yarnpkg/yarn] There appears to be trouble with your network connection.](https://www.huanggr.cn/wp-content/uploads/2020/04/d540de50236459c09daeefaac159827a.png)
目前我使用cnpm和npm来进行报的添加。
7