When running yarn add --dev jest, I got error Incorrect integrity when fetching from the cache.
yarn add --dev jest
Tried to upgrade yarn and it solved my problem. It may be due to the compatibility issue
yarn policies set-version
Will download the latest stable release
Reference : yarn docs https://yarnpkg.com/lang/en/docs/cli/policies/#toc-policies-set-version