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. Retryin
I encountered this error while attempting yarn outdated
. In my case, a few of the packages in my project were hosted in a private registry within the company network. I didn't realize my VPN was disconnected so it was initially confusing to see the error message whilst I was still able to browse the web.
It becomes quite obvious for those patient enough to wait out all five retry attempts. I, however, ctrl-c'd after three attempts...
The large package involved often can be Material Design Icons.
Check if you make use of the Material Design Fonts material-design-icons
in your package.json
and remove it!
material-design-icons
is too big to handle and you should only use material-design-icons-fonts
if you only need them.
https://medium.com/@henkjan_47362/just-a-short-notice-for-whomever-is-searching-for-hours-like-i-did-a741d0cd167b
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
yarn install --network-timeout=30000
vim ~/.yarnrc
and add useful proxy setting.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
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