yarn is having troubles with the network connection

后端 未结 12 1968
伪装坚强ぢ
伪装坚强ぢ 2021-02-12 19:02

I tried to install a package with yarn earlier today and I got this

yarn install
yarn install v1.9.4
[1/4]          


        
相关标签:
12条回答
  • 2021-02-12 19:44

    i had a different error, but the same network connection issue. i read through this thread: https://github.com/yarnpkg/yarn/issues/15

    and ended up uninstalling/reinstalling node/npm which fixed my issue. maybe there's something wrong with your node installation too?

    0 讨论(0)
  • 2021-02-12 19:46

    retrying few times worked out for me on similar issue.

    0 讨论(0)
  • 2021-02-12 19:46

    I have tried a lot:

    • npm clean cache
    • yarn clean cache
    • yarn config delete proxy
    • yarn config delete https-proxy
    • yarn config delete registry
    • yarn install --network-timeout 1000000

    finally it works!

    0 讨论(0)
  • 2021-02-12 19:49

    Check your internet speed / strength of connection. I had this problem while I was on a spotty public wifi. Noticed that it was a different package that threw the error each time I tried. And once I got faster / more stable internet this problem went away. (The packages were too large for my poor connection).

    0 讨论(0)
  • 2021-02-12 19:50

    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

    0 讨论(0)
  • 2021-02-12 19:50

    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
    
    0 讨论(0)
提交回复
热议问题