The Yarn package manager has an option called enableGlobalCache
which makes yarn store its package cache in a global folder. Yarn's normal mode is to store its cache in <cacheFolder>
which is in the project folder by default (.yarn/cache
).
What is the reason to use enableGlobalCache
? Is it just for saving disk space? Are there any downsides?
I am asking because I'm puzzled — if it has a use case and there are no downsides, then why is it not the default?
Yarn V4 answer
Doc says:
So you were right, there is no downside, but as it was a complete new feature (app local cache and global cache), the precautionary principle was to disable globalCache by default. Now it's enabled by default in Yarn v4.