For me, I was running 2 yarn installs simultaneously on 2 different projects on my machine and that caused the issue. I had to do the installs one after the other.
yarn install