How to increase the timeout for `yarn install`

Fabio K picture Fabio K · Dec 14, 2017 · Viewed 12.3k times · Source

I'm currently using Yarn on a very unstable internet connection. Sometimes it takes hours until I can finally download all the packages.

I noticed Yarn retries the download when there is some kind of the internet connection:

[1/4] Resolving packages...
31-Dec-1969 21:00:00    [INFO] info There appears to be trouble with your 
network connection. Retrying...
31-Dec-1969 21:00:00    [ERROR] error An unexpected error occurred: 
"https://github.com/flot/flot: getaddrinfo EAI_AGAIN github.com:443".

Is it possible to retry forever until it downloads or increase the timeout?

Something like {timeout: 9999999}

Answer

Crono picture Crono · Jul 3, 2018

Try using the network-timeout flag with a delay in milliseconds, like this:

yarn install --network-timeout 1000000000