Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsApr 11, 2026·2 min de lectura

pnpm — Fast, Disk-Space Efficient Package Manager

pnpm is a fast, disk-space efficient package manager for Node.js. Uses a content-addressable store and symlinks to avoid duplicating packages across projects — saves gigabytes and installs 2x faster than npm.

Introducción

pnpm is a fast, disk-space efficient package manager. Uses a content-addressable store + symlinks so every version of every package exists once on disk, shared across all your projects. Solves npm/yarn disk bloat and duplication.

What pnpm Does

  • Fast installs — 2-3x faster than npm
  • Disk efficient — global content-addressable store (~/.pnpm-store)
  • Strict node_modules — no phantom dependencies
  • Monorepo — first-class workspace support
  • Deterministic — pnpm-lock.yaml
  • Catalogs — shared version ranges across workspace
  • Patches — patch-package built in

Architecture

Global store at ~/.pnpm-store/v3 holds all package tarballs (content-addressed). Each project gets a node_modules/.pnpm directory with hardlinks to the store, then symlinks in node_modules/ to expose direct deps. Non-direct deps stay hidden (no phantom deps).

Self-Hosting

CLI tool — install locally, no server.

Key Features

  • 2-3x faster than npm/yarn classic
  • Up to 50% disk space savings
  • Strict dependency resolution
  • Workspace/monorepo first-class
  • pnpm dlx for one-off commands
  • Built-in pnpm patch for upstream fixes
  • Catalogs (v9+) for shared versions
  • Side-effects cache

Comparison

Manager Speed Disk Monorepo Strict
pnpm Fast Best First-class Yes
Yarn Berry Fast Medium First-class PnP
npm Slowest Worst Workspaces No
Bun Fastest Good Basic No

FAQ

Q: Will it break existing projects? A: A few older packages that rely on phantom deps will throw errors. Fix: add them explicitly to package.json or use public-hoist-pattern.

Q: Does it pair with Turborepo/Nx? A: Perfectly. pnpm handles dependencies; Turborepo/Nx handle task orchestration and caching.

Q: Can it replace Yarn workspaces? A: Yes. Migration usually just involves moving workspaces from package.json into a pnpm-workspace.yaml file.

Sources & Credits

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados