Very interesting, thanks!
How does pnpm manages cleanup though? With npm, you delete the project folder, and node_modules disappear. Is pnpm able to detect some deps in the cache are now dangling and useless?
If not, does it mean cleanup requires deleting the pnpm folder, and re-run pnpm install on all projects? (which no one will do and thus the pnpm folder may grow indefinitely?)
Yes, the pnpm cache grows indefinitely basically but there is usually a lot of overlap of dependencies between projects. Pruning the store every once in a while is a good idea. You can do it via pnpm store prune, which removes unreferenced packages that are not used by any project.
great question, I use pnpm daily and I see it has pnpm prune command, but I never tested it. If it works as same as docker volume prune, it's exactly what we need.
Yes, the pnpm cache grows indefinitely basically but there is usually a lot of overlap of dependencies between projects. Pruning the store every once in a while is a good idea. You can do it via pnpm store prune, which removes unreferenced packages that are not used by any project.
Very interesting, thanks!
How does pnpm manages cleanup though? With npm, you delete the project folder, and node_modules disappear. Is pnpm able to detect some deps in the cache are now dangling and useless?
If not, does it mean cleanup requires deleting the pnpm folder, and re-run pnpm install on all projects? (which no one will do and thus the pnpm folder may grow indefinitely?)
Thank you for your questions, @derlin!
Yes, the pnpm cache grows indefinitely basically but there is usually a lot of overlap of dependencies between projects. Pruning the store every once in a while is a good idea. You can do it via
pnpm store prune
, which removes unreferenced packages that are not used by any project.great question, I use pnpm daily and I see it has
pnpm prune
command, but I never tested it. If it works as same asdocker volume prune
, it's exactly what we need.Unfortunately, even the document:
It doesn't seems easy to understand how it actually works.
May Sylwia help us to clarify?
Thank you, @ndaidong! I think we posted at the same time - yes, you're right about
pnpm prune
!Thank you for your questions, @derlin!
Yes, the pnpm cache grows indefinitely basically but there is usually a lot of overlap of dependencies between projects. Pruning the store every once in a while is a good idea. You can do it via
pnpm store prune
, which removes unreferenced packages that are not used by any project.You're rock! We need
pnpm store prune
. Just cleaned :)