I am doing some benchmark tests for Facebook's Yarn. For this, I need to clear my global Yarn cache.
Is there a command available for this? I have force-removed my ~/.yarn-cache folder, but this seems to be quite manual.
To clear a cache in yarn, we need to run the yarn cache clean command in our terminal. This above command deletes all data from your cache directory. If you want clear a cache for the particular package or module, you can do it like this. If you want to print out every cached package that stores in your ~/.
yarn currently save cached packages in a default directory: /Users/<user>/Library/Caches/yarn or C:/Users/<user>/AppData/Local/Yarn/cache . When a lot of packages are cached, each user on the system to consume a lot of space on the primary drive.
Yarn stores every package in a global cache in your user directory on the file system. yarn cache list will print out every cached package. yarn cache list --pattern <pattern> will print out every cached package that matches the pattern provided.
Ok I found out the answer myself. Much like npm cache clean, Yarn also has its own
yarn cache clean
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With