Yarn - There appears to be trouble with your network connection. Retrying

北慕城南 提交于 2020-01-12 04:30:27

问题


I have been trying to do the quickstart guide for react native, but kept getting this error

There appears to be trouble with your network connection. Retrying...

My connection works just fine.


回答1:


This happens when your network is too slow or the package being installed is too large, and Yarn just assumes it's a network problem. Try increasing Yarn network timeout:

yarn add <yourPackage> --network-timeout 100000



回答2:


I got this issue because I was working within my company internal network and proxy needed to be set.

$ yarn config set proxy http://my_company_proxy_url:port
$ yarn config set https-proxy http://localhost:3128

example $ yarn config set https-proxy http://proxy.abc.com:8080



回答3:


Simple working solution (right way of doing it):

Looks like yarn was trying to connect via a proxy. The following worked for me:

npm config rm proxy
npm config rm https-proxy

Source: https://github.com/yarnpkg/yarn/issues/4890




回答4:


  1. Could be that your network speed is too slow and timeout is relatively short, you can set yarn install --network-timeout=30000
  2. If you still have the error, could be solved by proxy, vim ~/.yarnrc and add useful proxy setting.



回答5:


Turning off "real time protection" with windows defender fixed it for me.

Sucks but it appears the checks are too much for yarn to handle.




回答6:


Deleting the yarn.lock file and rerunning "yarn install" worked for me.




回答7:


Could be a proxy issue. Run the command below to delete the proxy.

yarn config delete proxy


来源:https://stackoverflow.com/questions/51508364/yarn-there-appears-to-be-trouble-with-your-network-connection-retrying

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!