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

后端 未结 10 2011
南笙
南笙 2020-12-23 11:23

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         


        
相关标签:
10条回答
  • 2020-12-23 11:45

    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...

    0 讨论(0)
  • 2020-12-23 11:46

    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

    0 讨论(0)
  • 2020-12-23 11:48

    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
    
    0 讨论(0)
  • 2020-12-23 11:49
    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.
    0 讨论(0)
  • 2020-12-23 11:54

    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
    
    0 讨论(0)
  • 2020-12-23 11:56

    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

    0 讨论(0)
提交回复
热议问题