yarnのIncorrect integrity when fetching from the cacheではまった(初歩的?)
Macでyarnを入れて適当なディレクトリで何か開発しようと思ったら以下のエラーが。
$ yarn add XXX yarn add v1.19.0 [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... error Incorrect integrity when fetching from the cache info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
前提として、ndenvを導入していて、yarnを入れる前にnpmを使っていました。後からndenvでnodeのバージョンを指定した際に同時にyarnをインストールしてくれるndenv-yarn-installでyarnをインストールしています。
error Incorrect integrity when fetching from the cache
でググってもあんまりそれらしい回答が見つからない。
cacheあたりが何か問題何だろうと思ってyarn cache
でググって見つけた以下のyarnの公式ページのコマンドを叩いたら解決した。
$ yarn cache dir # なんかずらずら出てくる $ yarn cache clean # 綺麗になる $ yarn cache dir # 空になる