TL;DR

pnpm cuts clean‑install times by ~65 % compared to npm and Yarn, shares packages across every project, and ships first‑class monorepo tooling out of the box.

Intro

I love Yarn. It’s fast, it’s reliable, and it’s the package manager I’ve used for years. But as my projects multiplied, (I have too many personal repos) I started to notice a problem: node_modules takes up a lot of space on it's own, but having several projects, or a few very large projects makes it more noticeable. I had multiple copies of the same package (React) in different projects, and it was taking up a ton of space on my drive.

But that's just how it is right? I mean, npm and Yarn are the only package managers we have, and they both do the same thing. They install packages into your project’s node_modules folder, and that’s it. But what if I told you there’s a better way?

The solution? pnpm, the package manager that’s faster, smaller, and more monorepo‑friendly than npm or Yarn. There are many ways to install pnpm, but for ease of use, this tutorial will assume you have npm/yarn installed.

I apologize for making this sound like an advertisement, but I promise you, it’s not. I’m just a developer who’s tired of waiting for npm and Yarn to install packages, and I want to share my experience with you.

The node_modules bloat we’ve all ignored

If you’ve ever opened Finder and gasped at a 15 GB ~/Projects folder, you’ve already met the problem. npm (and Yarn) clone every dependency into every project. One hundred apps that depend on React mean one hundred copies of React on your SSD.

Note: Yarn’s Plug’n’Play is blazing too, but it requires code that understands .pnp.cjs. pnpm wins on drop‑in compatibility.

Meet pnpm (Performant npm)

pnpm flips that model on its head. It keeps one global, content‑addressable store in ~/.pnpm-store and symlinks packages into each project’s node_modules.

  • No duplication -> huge disk savings
  • Hard‑links + parallel fetches -> much faster installs

Under the hood, pnpm’s three‑phase workflow (resolve -> fetch -> link) is faster than streaming thousands of files into every project folder.

Real‑world numbers

The official 2025 benchmark tells the tale:

Scenario npm Yarn v1 pnpm
Clean install 27.2 s 9.3 s 8.9 s
Re‑install w/ cache & lockfile 1.3 s 5 s 0.85 s

pnpm is roughly 3× faster than npm on a fresh clone and even edges out Yarn on cached runs.

Disk usage shows a similar gap: a mono‑repo with ten packages and shared deps takes ~1.2 GB with npm, but <300 MB with pnpm thanks to hard‑links.

Built‑in monorepos that don’t fight you

Drop a pnpm-workspace.yaml at the repo root and you instantly gain:

  • Recursively running scripts across packages (pnpm -r dev)
  • Smart workspace: protocol for local linking
  • Deterministic, single lock‑file publishing flow

That’s the same workflow adopted by Next.js, Vite, Nuxt, Astro, and Prisma after they all migrated in 2022‑24. This isn't some trendy new thing; it’s the future of package management.

Fewer “works on my machine” bugs

Because pnpm only hoists direct dependencies, your code can’t accidentally import a package you forgot to list in package.json. That class of subtle, environment‑dependent bug just vanishes.

Try it out

Wanna try it out on your own project? You must have Node 18+ to use pnpm, as it ships with Corepack by default. Corepack ships with Node 18+ as a shim manager, letting you pin PNPM/Yarn versions per project.

You can install pnpm globally using npm or yarn, but it’s recommended to use Corepack. Using npm or yarn you can use the following command:

# NPM
npm install -g pnpm@latest-10
# Yarn
yarn global add pnpm@latest-10

Now, to convert an existing project to pnpm, you can use the following command:

pnpm import # Renames yarn.lock / package-lock.json -> pnpm-lock.yaml

Then install the dependencies using:

pnpm install

Now just update your scripts in package.json to use pnpm instead of npm or yarn. For example, if you have a script that runs npm run build, you can change it to pnpm run build.

That's it! You’re now using pnpm. You can check the pnpm documentation for more details.

Caveats & quick fixes

As with any new tool, there are a few quirks to watch out for:

Symptom Fix
Tooling dislikes symlinks add node-linker=hoisted to .npmrc
Windows network drives break hard‑links set --use-hard-links=false
Muscle memory still types npm use npm exec -c 'pnpm $@'

The bottom line

npm is the venerable default, Yarn gave us speed, but pnpm is the 2025 sweet spot—blazing fast, space‑savvy, and monorepo‑friendly. Unless a tool explicitly blocks it, there’s no reason to keep lugging multi‑gigabyte node_modules around.

So rip off the band‑aid, run pnpm import, and watch your install times drop.

Plugs

Enjoy my content? You can read more on my blog at The Glitched Goblet or follow me on BlueSky at kaemonisland.bsky.social. I'll be updating older posts and adding new ones each week, so be sure to check back often!