Skip to main content

What is the store in pnpm?

The store in pnpm is the centralized storage (cache) where pnpm keeps the single copies of every downloaded package. This store lives outside node_modules and is used by every project on the machine.


What the store does

  1. Stores downloaded dependency versions
  • one version of a package lives in the store only once, even if it is used in a hundred projects.
  1. Is used as the source for node_modules
  • during install, pnpm does not copy packages into the project, it creates hard links to the files in the store.
  1. Speeds up repeat installs
  • if a package is already in the store, pnpm does not download it again.

Where it is stored

Usually in a directory like:

javascript
~/.pnpm-store

The exact location can be found with:

bash
pnpm store path

Why this matters

CapabilityWhat it gives
A single storedisk space savings
Hard linksfaster installation
No duplicatesclean, lightweight node_modules

Summary

The store in pnpm is a global package cache from which pnpm distributes dependencies to every project, using hard links instead of copying. This is the foundation of pnpm's performance and space savings.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.