Adding this comment for other Googlers: What worked for me was increasing the Yarn network timeout:
yarn add YourPackageHere --network-timeout 100000
Apparently the package I was installing was too large (or my network too slow) so it assumed it was a network problem. It might've been, but this solved it. Just took a while.