Yarn website says the following:-
Yarn stores every package in a global cache in your user directory on the file system.
- You can use
yarn cache list
& it will print out every cached package. Just in case you wanted to go through. - You can use
yarn cache clean
& it will clean the cache (Note that it’s a time taking process and considering your cache size this will be forever!) - You can use
yarn cache dir
and it will display the path where it’s storing the cache! You know what to do next, userm -rf yarn-cache-dir
this will free up your space and clear all the cache as well.
Note generally your yarn cache dir can be found at ~/.cache/yarn/
. In my system the cache is stored in ~/.cache/yarn/v6/
.
UPDATE:- It’s recommended to use latest version of yarn.