Short answer
pnpm keeps one copy of each file in a content-addressable store and links it into projects. By default it hard-links those files and puts only direct dependencies at the root of node_modules. npm has hoisted dependencies toward the top of that folder since version 3. Speed tables from the homepage are left out.
Last verified against the sources listed below.
Key takeaways
- pnpm stores a dependency once in a content-addressable store and hard-links it into projects.
- A changed file in a new version is the only new file added, not a full second copy of the package.
- Installs run in three overlapping stages: resolve, calculate the directory layout, then link.
- The default node_modules layout exposes direct dependencies, not every nested package.
- nodeLinker set to hoisted builds a flatter tree for tools that cannot use symlinks.
A direct answer to what is pnpm: it is a package manager for JavaScript that keeps one copy of each file in a content-addressable store. The motivation page contrasts that with npm, which would save a full copy of a dependency in every project that uses it.
The store is why a second app does not pay the full disk cost of the same version again. The layout is also stricter, which is the part that changes how JavaScript imports resolve.
How does the store save space?
If 100 projects depend on the same package, npm keeps 100 copies. pnpm keeps the files in one store. Different versions add only the files that differ.
The page’s example is a 100-file package with one file changed: the update adds one file.
When a project installs, files are hard-linked or cloned with copy-on-write from that store. The page says this uses no extra disk space when the filesystem supports it. pnpm copies only when neither method exists.
That fallback is the packageImportMethod setting.
Why is the install described as faster?
pnpm lists three stages: resolve dependencies and fetch them to the store, calculate the node_modules layout, then link. A package advances as soon as it is ready. It does not wait for every other package to finish the same stage.
The page calls the older pattern a traditional three-stage install that resolves everything, then fetches everything, then writes everything. pnpm overlaps those stages. It does not publish a benchmark time on that page, so there is no seconds figure to repeat here.
What is different about node_modules?
npm and Yarn Classic hoist packages to the root of node_modules. Source code can then import a package the project never declared. pnpm, by default, uses symlinks so only direct dependencies appear at that root.
| Behavior | What the pnpm motivation page says |
|---|---|
| Disk layout | One content-addressable store, hard links into projects |
| New version | Only changed files are added to the store |
| Default node_modules | Direct dependencies, via symlinks |
| Hoisted mode | nodeLinker set to hoisted, closer to npm and Yarn Classic |
| Install stages | Resolve, calculate directories, link, overlapped |
If a tool fails on symlinks, set nodeLinker to hoisted. The page says that produces a directory similar to npm and Yarn Classic. You keep the store, and you give up the strict root.
Which installer lines matter?
The installation page says pnpm 12 is a native executable and does not need Node.js after it is installed. The pnpm package on npm installs on Node.js 18 or newer. The npx get-pnpm installer requires Node.js 22.13 or newer.
pnpm 12 is the current release line named there.
Those floors are about installing pnpm itself. Your app can still declare an older Node engine. Read both, and do not treat the installer floor as your production runtime.
What should you not assume?
Do not assume every package on disk is importable. That was the hoist behavior pnpm avoids by default. A missing import usually means the package is not a direct dependency, which is the point of the layout.
Do not assume a CI script written for npm ci will install this store. Commit the lockfile pnpm writes, and run pnpm in CI. An SVG minifier such as the SVG minifier is unrelated to the store.
It only shrinks an SVG you ship beside those packages.
Where does npm put a local install?
npm’s folders page says a local install goes in node_modules of the current package root. A global install, using the -g flag, goes where Node itself is installed. The prefix config defaults to that location: /usr/local on most systems, and %AppData%\npm on Windows.
That is the tree pnpm is avoiding at the root. npm will let a project require a package that was hoisted there. pnpm’s default layout does not.
If you need the npm shape, hoisted mode is the switch, not a second copy of the store.
Keep the two commands apart in documentation. A local npm install and a pnpm install do not write the same directory, even when the package names match. The store path is pnpm’s, and the prefix path is npm’s global default.
How does Node resolve a bare import?
Node starts at the current file, looks in node_modules, and walks up through parent folders.
The modules documentation says a name that does not start with a slash or a dot is loaded that way. Node also resolves the real path of a symlink before it looks for that file’s dependencies. pnpm’s default root is a set of symlinks to direct dependencies.
The lookup follows the link, then looks beside the real files. That is why a package you declared can still find its own dependencies, and why a package you did not declare is missing at the root.
Which pnpm 12 facts are on the install page?
The installation page says pnpm 12 is the current release line, and that the native build does not need Node.js after it is installed.
The pnpm package on npm installs on Node.js 18 or newer. The npx get-pnpm installer needs Node.js 22.13 or newer. The compatibility table on that page marks pnpm 12 as working with Node.js 18, 20, 22, 24, and 26, and it says pnpm 12 needs Node.js only when you install it from npm.
The standalone script runs without Node.js. FreeBSD, ppc64le, s390x, RISC-V, and Android binaries were added in v12.4.0. Leaving PATH unchanged needs 12.16.0 or newer.
Those numbers are about installing pnpm. They are not a claim about how fast an install runs, and they are not your app’s engines field. On Windows, the same page says Defender may block the standalone executable, and it recommends installing with npm in that case.
ESLint’s getting-started page lists a pnpm command beside npm, yarn, and bun. It also tells pnpm users to set auto-install-peers=true and node-linker=hoisted in .npmrc, which is the hoisted escape hatch from the motivation page.
Frequently asked questions
Does pnpm still use node_modules?
Yes. The motivation page says pnpm calculates a node_modules directory and then hard-links files into it from the store. By default, symlinks expose direct dependencies, not every nested package. A library you did not declare is not importable just because another package uses it. If a tool breaks on symlinks, set nodeLinker to hoisted so the tree looks more like npm or Yarn Classic.
Why is a second project smaller on disk?
The store already holds the files. pnpm hard-links or clones them with copy-on-write, which the page says consumes no additional disk space when the filesystem supports it. It copies only when neither method is available, and that choice is the packageImportMethod setting. A new version of a package adds only the files that differ. The page's example is a package of 100 files with one file changed: the update adds that one file, not another full copy.
What are the three install stages?
The motivation page lists dependency resolution, directory structure calculation, and linking. Resolution identifies what is required and fetches it to the store. The next stage calculates the node_modules layout. Linking then hard-links the remaining files from the store. A package moves to the next stage as soon as it is ready, instead of waiting until every package has finished the current stage. That overlap is the speed claim. The page does not publish a stopwatch number, so this guide does not invent one.
Which Node.js version does the installer mention?
The pnpm installation page says pnpm 12 is a native executable and does not require Node.js after it is installed. The pnpm npm package installs on Node.js 18 or newer. The npx get-pnpm installer requires Node.js 22.13 or newer. pnpm 12 is the current release line on that page. Check the page again if you install months later, because those floors are about the installer, not about the packages your app itself runs.
When should you not switch?
Stay on npm if a required tool reads a flat node_modules tree and you cannot set nodeLinker to hoisted. pnpm's default root will not expose a package you did not declare, which is the behavior the motivation page describes. npm's folders page says a local install unpacks into node_modules and has hoisted dependencies since version 3. Use the install command that matches the lockfile you committed. The disk gain pnpm describes is one shared store, not a second copy of every project.
Sources
- Motivation · pnpm, 2026
- Installation · pnpm, 2026
- npm folders · npm, 2026
- Modules: loading from node_modules · Node.js, 2026
- Getting Started with ESLint · ESLint, 2026