-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yarn wastefully caches and duplicates file:* dependencies #7198
Comments
This looks like a duplicate of #2165, which is closed for whatever reason, but we are still running into the same problem today. |
I still seem to have this problem although I will have to double check. Had to clear our 20-30GB of Yarn cache a few times in a day and I worry it's gonna wear out my hardware. Also, the docs say the cache should be in ~/.yarn/cache (or was it the other way around). There is no built-in way to disable it either. |
Still an issue in 2021 🙃. |
Still seems to be an issue 2023 |
wow - yes this is still an issue: just clearing my yarn cache dir which was ~250GB mostly due to |
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
When using a
file:<path>
dependency format, Yarn caches the contents of the local directory every time yarn reinstalls packages (e.g. onyarn --force
). This is wasteful, because the directory is already present locally and doesn't need caching. But more importantly, it can bloat Yarn cache very quickly if the dependency folder is relatively large, because it always creates a new copy even if the contents are the same.I discovered this when I found out my Yarn cache directory is 10GB, most of which is dozens of copies of the same folder I had as a file dependency.
If the current behavior is a bug, please provide the steps to reproduce.
Then run
yarn --force
multiple times. Every run will generate a new copy of the dependency:What is the expected behavior?
Yarn should not cache
file:<path>
dependencies at all.Please mention your node.js, yarn and operating system version.
OS: macOS Mojave v10.14
Node: v10.15.2
Yarn: 1.15.2
The text was updated successfully, but these errors were encountered: