Skip to content
Latchkey

pnpm store prune: Usage & Common Errors

Reclaim disk by pruning the pnpm store.

pnpm store prune deletes packages from the global content-addressable store that are no longer referenced by any project - the way to reclaim disk without breaking installs.

What it does

Removes store entries with no remaining hard links from any project. Because the store is content-addressable and shared, only truly orphaned packages are deleted, so active projects are unaffected. pnpm store status reports what would change.

Common usage

Terminal
pnpm store prune            # remove orphaned packages
pnpm store status           # check store integrity
pnpm store path             # print the store location

Common CI pattern: free disk on no-space-left

A self-hosted runner fills its disk over many builds because the pnpm store grows unbounded. Run pnpm store prune in a cleanup step (or periodically) to drop orphaned packages - far safer than deleting the whole store, which forces every project to re-fetch.

.github/workflows/ci.yml
pnpm store prune            # reclaim disk between builds

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →