I tried to install a package with yarn earlier today and I got this
yarn install
yarn install v1.9.4
[1/4]
Check your internet speed / strength of connection. I had this problem while I was on a spotty public wifi. Noticed that it was a different package that threw the error each time I tried. And once I got faster / more stable internet this problem went away. (The packages were too large for my poor connection).