Yarn stores every package in a global cache in your user directory on the file
yarn cache ls will print out every cached package.
yarn cache dir will print out the path where yarn’s global cache is currently stored.
Running this command will clear the global cache. It will be populated again the
yarn install is run. Additionally, you can specify name of package you want to clean.
cache-folder config value to configure the cache directory.
yarn config set cache-folder <path>
You can also specify the cache directory by flag
yarn <command> --cache-folder <path>
You can also specify the cache directory by environment variable
YARN_CACHE_FOLDER=<path> yarn <command>