This happens when your network is too slow or the package being installed is too large, and Yarn just assumes it's a network problem. Try increasing Yarn network timeout:
yarn add <yourPackage> --network-timeout 100000
Deleting the yarn.lock file and rerunning "yarn install" worked for me.
I got this issue because I was working within my company internal network and proxy needed to be set.
$ yarn config set proxy http://my_company_proxy_url:port
$ yarn config set https-proxy http://localhost:3128
example $ yarn config set https-proxy http://proxy.abc.com:8080
yarn install --network-timeout=30000
vim ~/.yarnrc
and add useful proxy setting.Turning off "real time protection" with windows defender fixed it for me.
Sucks but it appears the checks are too much for yarn to handle.
Simple working solution (right way of doing it):
Looks like yarn was trying to connect via a proxy. The following worked for me:
npm config rm proxy
npm config rm https-proxy
Source: https://github.com/yarnpkg/yarn/issues/4890
Could be a proxy issue. Run the command below to delete the proxy.
yarn config delete proxy
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