Bottom Line: You can safely prune the pnpm store using pnpm store prune. This removes old, unreferenced package files that are no longer linked to any active JavaScript project on your computer.
What is the pnpm Store Folder?
Located at ~/.local/share/pnpm/store on Linux, ~/Library/pnpm/store on macOS, or %LocalAppData%\pnpm\store on Windows, the pnpm store is a global content-addressable storage directory used by pnpm.
Unlike npm which copies dependencies into every node_modules folder, pnpm saves a single hard-linked copy of each package inside its global store. However, when you delete JavaScript projects or upgrade dependencies, old package versions remain in the global store indefinitely, occupying 5 GB to 20 GB+.
Can You Delete / Prune the pnpm Store?
- Pruning via
pnpm store prune: ✅ 100% safe. It scans all projects on your system and only deletes packages that are no longer used by any active project. - Manually deleting the entire store folder: ⚠️ Use Caution. If active projects rely on hard links in the store, wiping the store manually will break those active projects until you run
pnpm installagain.
How to Safely Clean Up pnpm Store
Method 1: Use pnpm store prune (Recommended)
Run this single command in terminal:
pnpm store prune
What it does: It checks every package file in the global store. If no project links to that package version anymore, pnpm deletes it, instantly reclaiming space.
Method 2: Force Re-build Store Path
To check store status and disk usage:
pnpm store status
Related Guides
- Learn about deleting node_modules folders.
- How to clean up npm cache.
- Check if you can clean Yarn cache.
Discussion
Loading authentication...