Skip to content
Latchkey

pnpm store prune and store path

The pnpm store holds every package version once, shared across projects.

Caching the store is the single biggest pnpm CI speedup. store prune reclaims space by removing unreferenced packages.

Common usage

  • pnpm store path - print the store dir (cache this)
  • pnpm store prune - remove unreferenced packages
  • pnpm store status - check integrity

Example in CI

Expose the store path for the cache step.

shell
pnpm store path

In CI

Cache the directory from pnpm store path keyed on pnpm-lock.yaml. Managed runners like Latchkey keep this store warm across jobs.

Key takeaways

  • Cache the dir from pnpm store path.
  • store prune reclaims space.
  • Key the cache on the lockfile.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →