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.
The following helped me
yarn config delete https-proxy
yarn config delete proxy
they set your https-proxy and proxy values to undefined. My https-proxy was set to localhost. Check that proxy and https-proxy config values are undefined by using the following
yarn config get https-proxy
yarn config get proxy
yarn config set network-timeout 600000 -g
Often, your error is caused by hitting the network connection time limit, and yarn simply reports there is "trouble with your network connection".
The line of code at the top of my answer sets the global yarn network timeout to 10 minutes.
Having a long network timeout is probably okay, because yarn uses caches and if it's big and you don't have it, you probably want it to just go ahead and take the time to download.
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... 😒
This happened in my case trying to run yarn install
.
My project is a set of many sub-projects. After a couple of retries, it showed a socket-timeout error log:
error An unexpected error occurred: "https://<myregitry>/directory/-/subProject1-1.0.2.tgz: ESOCKETTIMEDOUT".
I cloned subProject1
separately, did yarn install
on it and linked it with main project.
I was able to continue with my command on main project after that.
Once done, I unlinked the subProject1
and did a final yarn install --force
which was success.
taobao.org
which is very slow. I just deleted the file.vuerc
from my home folder and make sure I selectedno
when Vuejs prompted to use thetaobao.org
registry. – user3502626--network-timeout 100000
, turning off Windows Defender, clearing proxy settings, disabling IPv6, and runningyarn cache clean --force
I get "There appears to be trouble with your network connection. Retrying..." a few times followed by:error An unexpected error occurred: "https://registry.yarnpkg.com/@electron-forge/template-typescript/-/template-typescript-6.0.0-beta.57.tgz: read ECONNRESET"
though I can copy/paste this link into a web browser and quickly download without problems.npm install
also works... ug – jacobq