npm, Yarn and pnpm all install from the npm registry and read the same package.json, so switching between them is mostly a lockfile change. Where they differ is node_modules layout, how strictly they block undeclared dependencies, and which security defaults they ship. Latest releases as of November 2026: pnpm 12.18.0, npm 12.2.2 and Yarn 4.18.1.
npm is installed with Node.js, which makes it the zero-setup option. It builds a hoisted, flat node_modules unless you pick another install strategy; the linked strategy puts packages in node_modules/.store, and npm's docs suggest it during development to catch phantom dependencies. Recent npm also has min-release-age and before options to avoid very fresh versions.
Modern Yarn defaults to Plug'n'Play, which replaces node_modules with a single .pnp.cjs loader and blocks undeclared dependencies. Expect some editor setup, and React Native and Expo still need a normal node_modules, which you get with nodeLinker: node-modules. Yarn also offers constraints, a lint-style rule set for monorepo package.json files, and focused installs for a single workspace.
pnpm sits between them: a real node_modules, made strict through symlinks, with each package version stored once on disk and hard-linked into projects.
How they compare
| Aspect | pnpm | npm and Yarn |
|---|---|---|
| Getting it | Separate install; can also pin Node.js per project. | npm: comes with Node.js. Yarn: separate install. |
| Default layout | Symlinked node_modules with only direct dependencies at the root. | npm: hoisted, flat node_modules. Yarn: Plug'n'Play loader instead of node_modules. |
| Disk use | One content-addressable store, hard-linked into each project. | npm: packages written into each project. Yarn: PnP shares packages across projects on a disk. |
| Phantom dependencies | Blocked by the layout. | npm: reachable when hoisted; the linked strategy catches them. Yarn: blocked under PnP. |
| Install scripts | Dependency scripts blocked until approved with allowBuilds. | npm: run unless you pass --ignore-scripts. Yarn: not covered in the docs pages we checked. |
| Fresh-release delay | minimumReleaseAge, 24 hours by default. | npm: min-release-age in days, or a before date. Yarn: not covered in the pages we checked. |
| Monorepos | Workspace protocol, filtering and catalogs. | npm: workspaces. Yarn: workspaces, workspace: protocol, focused installs and constraints. |
Choose pnpm if…
- You want strict dependencies but keep node_modules
- You keep many projects on one machine
- You want safe install defaults without extra config
- You run a large monorepo with shared catalogs
Choose npm and Yarn if…
- npm: you want nothing extra to install on CI or laptops
- npm: your tools expect a plain hoisted node_modules
- Yarn: you want Plug'n'Play and its strictness
- Yarn: you want constraints to police monorepo manifests
Researched November 2026 from each product's official documentation and pricing pages. Prices and features change often, so check the vendors' sites before you decide.
Sources
- pnpm.io
- pnpm.io /motivation
- docs.npmjs.com /cli/v11/commands/npm-install
- docs.npmjs.com /downloading-and-installing-node-js-and-npm
- yarnpkg.com /getting-started
- yarnpkg.com /features/pnp
- yarnpkg.com /features/workspaces
- github.com /pnpm/pnpm/releases
- github.com /npm/cli/releases
- github.com /yarnpkg/berry/releases