yarn is having troubles with the network connectio

2020-06-12 02:59发布

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

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

10条回答
做自己的国王
2楼-- · 2020-06-12 03:27

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?

查看更多
唯我独甜
3楼-- · 2020-06-12 03:27

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
查看更多
Viruses.
4楼-- · 2020-06-12 03:34

retrying few times worked out for me on similar issue.

查看更多
三岁会撩人
5楼-- · 2020-06-12 03:38

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.

查看更多
女痞
6楼-- · 2020-06-12 03:42

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

查看更多
Fickle 薄情
7楼-- · 2020-06-12 03:44

Try increasing network timeout

yarn install --network-timeout 1000000

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

查看更多
登录 后发表回答