# How to Clear the pnpm Cache and Reclaim Disk Space

> Find pnpm's store, compare cache sizes in MangoDisk, and choose between pruning unused packages and clearing a cache folder. Know what could affect your projects.

You deleted an old project, but pnpm's store is still taking up space. That isn't necessarily a failed cleanup: pnpm keeps downloaded packages in shared storage so other projects can reuse them. Deleting one project doesn't empty that store.

**Start with pnpm store prune if you want to remove unreferenced packages. To see how pnpm compares with your other development caches, scan with MangoDisk first.** You don't need to wipe the whole store or touch your source code and lockfile just to start freeing up space.

## See which development caches are worth clearing

If you've used npm, pnpm, Python, and Rust on the same computer, their caches can be scattered across several folders. MangoDisk's [Deep Cleanup](/docs/features/deep-clean) brings supported caches into one view so you can compare their sizes without hunting down each folder.

![MangoDisk Deep Cleanup showing development cache sizes and paths on Windows](https://assets.mangodisk.app/images/screenshots/windows/en/light-01-deep-cleanup.jpg)

Expand the pnpm cache entry to check its path and size. A small cache may be worth keeping; a larger one deserves a closer look before you decide whether to prune it or clear it. Scanning alone doesn't delete anything.

MangoDisk currently checks `%LocalAppData%\pnpm\store` on Windows, plus `~/Library/pnpm/store` and `~/Library/Caches/pnpm` on macOS. If you've changed the store location, ask pnpm where it is:

```bash
pnpm store path
```

This only prints the path. **A custom store missing from MangoDisk's results doesn't mean there's no cache.** Open the returned folder in File Explorer or Finder to check its size.

## Use prune to remove unreferenced packages

Open PowerShell on Windows or Terminal on macOS. Wait for active installations and builds to finish, then run:

```bash
pnpm store prune
```

This removes unreferenced packages directly, without sending them to the Recycle Bin or Trash. It doesn't empty the entire store. If a later install needs one of those packages, pnpm downloads it again. The [pnpm documentation](https://pnpm.io/cli/store) recommends pruning occasionally, not after every install.

Files remaining afterward are expected. The goal is to remove unused packages, not to leave an empty folder. If you're about to work offline or can't currently reach a private registry, keep the cache for now so you don't lose packages you may need for an install.

## Clearing a cache folder is a different choice

If you've checked that a cache can be rebuilt and want to clear it rather than just prune unused packages, you can select its pnpm entry in MangoDisk. Deselect other items first, review the paths, then confirm the cleanup.

**MangoDisk clears the selected cache folders; it doesn't run prune or decide which individual packages your projects still use.** Finish related tasks first, check that the folders don't contain personal files, and make sure you can download dependencies again. See the [cleanup safety guide](/docs/safety) for deletion and recovery limits.

Be especially careful with the global virtual store. Projects configured to use it—and global tools whose dependencies live there—may need reinstalling if you delete the store. Don't wipe that directory. Use a supported pruning option for your pnpm version, or leave it alone if you're unsure. The [pnpm storage settings](https://pnpm.io/settings/node-modules#enableglobalvirtualstore) explain how those dependencies are linked.

Keep your source code, `package.json`, and `pnpm-lock.yaml`. Your project's `node_modules/.pnpm` isn't a spare cache folder either: it contains dependencies the project uses.

## Folder size isn't always recoverable space

pnpm can reuse files instead of keeping a separate copy for every project. With hard links, the store and a project folder can point to the same data on disk. Removing one link won't free that data while another still exists. See [pnpm's explanation of its directory structure](https://pnpm.io/symlinked-node-modules-structure).

Don't add up every folder's reported size and expect to reclaim that total. Compare the drive's free space before and after cleanup, and don't start deleting active dependencies just because the change was smaller than expected.

Still short on space? Use MangoDisk's [Disk Space Analysis](/docs/features/disk-analysis) to check your development folders. An old project, build output, or another tool's cache may be the bigger problem. Finding that is more useful than repeatedly clearing the same store.

[Download MangoDisk](/) to review scattered development caches in one place. Free and open source, with no signup or login.

Related: [Clear the npm cache](/blog/clean-npm-cache) · [Cargo caches versus target folders](/blog/cargo-cache-vs-target-folder) · [Developer cleanup guides](/blog/topics/developer-cleanup)
