Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

yarnpkg

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

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


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

  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.

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.


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


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

yarn config delete proxy