The short answer
- 01
Safe to clean with pnpm store prune. It removes only packages no project on your Mac references.
- 02
pnpm writes it on every install and hard-links its files into each project's node_modules, so a package is stored once.
- 03
Deleting the folder by hand keeps existing node_modules working, but files they still link to stay on disk, and every project downloads again on its next install.
- 04
The command: pnpm store prune. pnpm store path shows where the store is.
See its real size on your Mac. Hoardless measures this folder and previews the delete.Download free trial
What is the pnpm store?
The pnpm store is pnpm's content-addressable package store, one copy of every package file pnpm has downloaded. pnpm's settings reference gives the default storeDir on macOS as ~/Library/pnpm/store.
Two settings move it. With PNPM_HOME set, the store is $PNPM_HOME/store. Without it but with XDG_DATA_HOME, it is $XDG_DATA_HOME/pnpm/store, which is why some Macs have ~/.local/share/pnpm/store instead.
pnpm store path
Prints the active store. Removes nothing.
What writes it and why does it grow?
pnpm adds to it on every install. Each new package version is written to the store once, then linked into the project.
- Hard links, not copies: the pnpm FAQ says pnpm creates hard links from the global store to each project's
node_modules, and hard links point to the same place on disk. - Old versions stay: upgrading a dependency adds the new version; the old one remains until you prune.
- Deleted projects leave packages behind: removing a project removes its links, not the store's copy.
How big does the pnpm store get?
It depends on how many distinct package versions you have installed, so there is no normal size. Measure it, and know what the number means:
du -sh "$(pnpm store path)"
Prints the store's size. Removes nothing.
du counts every file in the store, including files that are the same bytes as a project's node_modules. That shared part is not freed by deleting the store alone, so the number is the most you could get back, not what you will get back.
Is it safe to delete the pnpm store?
pnpm's docs say running pnpm store prune is not harmful and has no side effects on your projects.
| What | Verdict | What you lose |
|---|---|---|
Unreferenced packages, via pnpm store prune | Safe | Packages no project uses. They download again if a project needs them. |
| The whole store, deleted by hand | Careful | Existing node_modules keep working. Every project downloads again on its next install, and linked files stay on disk. |
A project's pnpm-lock.yaml | Never | The exact versions the project was tested with. It is source, not cache, and lives in the project. |
How do I clean the pnpm store?
Use pnpm's own command:
pnpm store prune
Removes unreferenced packages from the store, clears pnpm's metadata cache, and reports the size it removed. pnpm calls it best practice to run it occasionally, but not too frequently.
The manual way: drag the folder pnpm store path prints to the Trash. Then delete node_modules in old projects too, or the space they share with the store is not freed.
What Hoardless does: its Node detector lists ~/Library/pnpm/store and ~/.local/share/pnpm/store at the Auto tier and runs pnpm store prune, using the pnpm your login shell finds. When pnpm is not installed, it offers to move the whole store to the Trash instead, raised to the Confirm tier with a note that projects re-download packages on their next install.
What comes back and when?
After a prune, nothing you were using. Only packages no project referenced were removed, and they come back only if a project, such as an old branch, installs them again.
After deleting the whole store, the next pnpm install in each project downloads its packages and rebuilds the store. To find the old projects that hold links into it, see node_modules.
Prune the pnpm store without guessing
Hoardless finds the pnpm store (Auto tier, pnpm store prune) next to the npm and Yarn caches, shows each size and previews the plan. Without pnpm installed, trashing the whole store is a separate Confirm tier item, never done silently.
14-day full trial. macOS 14 or later.
Questions
Why did deleting the pnpm store free so little space?
Files in the store are hard links shared with node_modules folders. The bytes are freed only when the last link is gone, so a store whose packages are still installed in projects frees little until those node_modules go too.
How often should I run pnpm store prune?
pnpm recommends running it occasionally, not too often. A package pruned today downloads again if an old branch needs it.
Where is the pnpm store on a Mac?
~/Library/pnpm/store by default. If PNPM_HOME is set it is $PNPM_HOME/store, and if XDG_DATA_HOME is set it is $XDG_DATA_HOME/pnpm/store. pnpm store path prints the active one.
Can the store be on an external drive?
Only for projects on that drive. Hard links work within one file system, so pnpm copies packages instead when the store is on another disk, which uses more space.
New guides by email
New guides and Hoardless releases, twice a month at most.
Confirm first. Unsubscribe in one click. Privacy.