Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to clear cache in Yarn?

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.

like image 314
nikjohn Avatar asked Oct 12 '16 06:10

nikjohn


People also ask

Can we delete yarn cache?

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 ~/.

Where is my yarn cache?

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.

Does yarn have a cache?

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.


1 Answers

Ok I found out the answer myself. Much like npm cache clean, Yarn also has its own

yarn cache clean 
like image 181
nikjohn Avatar answered Oct 11 '22 07:10

nikjohn