pnpm: The Fast, Disk-Efficient Package Manager You Probably Haven't Tried Yet
If you've been using npm or Yarn for a while, you've probably felt the pain of node_modules bloat. Every project clones the same dependencies over and over, eating up disk space and slowing down installs. Enter pnpm, a drop-in replacement that's fast, strict, and surprisingly clever about how it handles dependencies.
pnpm isn't new, but it's been quietly getting better. It's not just "npm but faster" — it changes the fundamental approach to how packages are stored and linked. The result? Install speeds that make you question why you ever waited for npm install in the first place.
What It Does
At its core, pnpm is a package manager for Node.js. You can use it the same way you'd use npm or Yarn: pnpm add, pnpm install, pnpm run. But under the hood, it uses a content-addressable file system to store all packages in a global store on your machine. Then, it uses hard links and symlinks to make those packages available inside your node_modules without duplicating them.
The result: you only download a package once, ever. If you have 10 projects using lodash, pnpm stores one copy and links to it from each project. That's a huge win for disk space.
Why It's Cool
Disk efficiency. This is the headline feature. With npm or Yarn, every npm install in a new project copies all your dependencies from scratch. With pnpm, the same package across projects shares a single copy on disk. I've seen projects shrink from 200MB to under 50MB on repeated installs.
Strict, deterministic deps. pnpm enforces a strict node_modules structure. It doesn't flatten dependencies like npm does. Every package only gets access to its explicitly declared dependencies, which means no accidental "barely works because a transitive dep happened to be hoisted" bugs. This sounds like a downside, but it actually makes your dependency tree more predictable and your package.json more honest.
Fast installs. Because pnpm reuses the global store, installs are dramatically faster, especially for things like CI or when you switch branches. In practice, pnpm install on an existing project is nearly instant if the store is warm.
No hoisting nightmares. You know the "phantom dependency" problem? Where your code uses a package that's not in your package.json but it happens to be installed because some other dependency pulled it in? pnpm kills that dead. Your code can only use what you explicitly declared. This is a lifesaver for team projects.
How to Try It
Getting started is dead simple. If you have Node.js installed, just run:
npm install -g pnpm
Or if you prefer a standalone binary (on macOS, Linux, or Windows via WSL):
curl -fsSL https://get.pnpm.io/install.sh | sh -
Then in any existing project:
cd your-project
pnpm install
That's it. You can even alias pnpm to npm in your shell if you want to try it without changing habits. The commands are mostly compatible: pnpm add, pnpm remove, pnpm run, pnpm update all work like you'd expect.
For a deeper look, check out the official docs.
Final Thoughts
I started using pnpm a few months ago, mostly because I was tired of running out of disk space on my laptop. The speed boost was a nice surprise, but the real win was the cleaner node_modules and the end of "it works on my machine" dependency issues. If you manage multiple Node projects, or even just one serious one, pnpm is worth a try. It's not a revolution, but it's a solid upgrade that makes package management feel a little less painful.
Give it a spin on your next project. You might not switch back.
Follow us on Twitter: @githubprojects for more developer tools and open source highlights.
Repository: https://github.com/pnpm/pnpm