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}
Yarnrc files (named this way because they must be called . yarnrc. yml ) are the one place where you'll be able to configure Yarn's internal settings. While Yarn will automatically find them in the parent directories, they should usually be kept at the root of your project (often your repository).
yarnrc files allow you to configure additional Yarn features. The config command may also be used to set these options. Yarn will merge . yarnrc files up the file tree.
Network timeout is an option that lets you decide how long you are willing to wait for an operation in a Workstation client before your request for that operation is canceled (timed out) on a network.
. yarn/install-state. gz is an optimization file that you shouldn't ever have to commit. It simply stores the exact state of your project so that the next commands can boot without having to resolve your workspaces all over again.
Try using the network-timeout
flag with a delay in milliseconds, like this:
yarn install --network-timeout 1000000000
You can configure it with this:
yarn config set network-timeout 600000 -g
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With