yarn is having troubles with the network connection

后端 未结 12 1969
伪装坚强ぢ
伪装坚强ぢ 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:51

    It may be the library was originally using npm instead of yarn. In my case I had to install everything with npm instead of yarn. I removed the yarn.lock file and then:

    npm install
    
    0 讨论(0)
  • 2021-02-12 19:54

    I got this as well.

    I ran yarn install --no-lockfile and it worked, so I deleted the node modules again and deleted yarn.lock. It looks like a bug in yarn, because yarn wasn't having issues in previous versions of my application.

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

    Try increasing network timeout

    yarn install --network-timeout 1000000
    

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

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

    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.

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

    I had the same network retrying issue when I used yarn install, simply using yarn worked for me.

    0 讨论(0)
  • 2021-02-12 20:04

    In my case, there was a hidden file .npmrc that had the registry pointed to a location in another private network, which my network did not have access to. Once, I commented out the private network related entries in this file, yarn install started working. Also, yarn-error.log was generated, that had this information.

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