yarn is having troubles with the network connection

I had the same issue and solved by following steps:

Run the terminal command

  1. Clean npm cache
  2. npm cache clean --force
  3. set http_proxy=
  4. Set https_proxy=
  5. Yarn config delete proxy
  6. Npm config rm https-proxy
  7. Npm config rm proxy
  8. Restart your terminal
  9. yarn
  10. Yarn –network-timeout 100000

Restart your terminal.

it worked for me.


Try increasing network timeout

yarn install --network-timeout 1000000

found this on GitHub issues https://github.com/yarnpkg/yarn/issues/4890


If you are using WSL for linux just add the current ip domain in: C:\Windows\System32\drivers\etc\hosts e.g:

104.16.21.35    registry.yarnpkg.com

Try clearing your cache

$ yarn cache clean
$ yarn // to install dependencies, no need for "yarn install"

Approach 2

$ yarn install --network-timeout 1000000

Reference https://github.com/yarnpkg/yarn/issues/4890#issuecomment-358179301