C.W.K.
Stream
Lesson 02 of 05 · published

Install pnpm

~7 min · pnpm, installation

Level 0Newbie
0 XP0/55 lessons0/16 achievements
0/80 XP to next level80 XP to go0% complete

pnpm has three install paths and any of them works. Pick whichever fits your existing toolchain.

Homebrew (recommended on macOS): brew install pnpm — keeps pnpm versioned alongside everything else in your Brewfile. Upgrades with the rest of your weekly brew upgrade ritual.

npm: npm install -g pnpm — simplest, but requires npm and the global-install permissions to be sane. Useful if you don't use Homebrew.

Corepack: corepack enable && corepack prepare pnpm@latest --activate. Corepack ships with Node.js 16.9+ and is Node's official package-manager-version-manager. The advantage is that you can pin pnpm's version in package.json ("packageManager": "pnpm@10.0.0") and corepack will use that exact version. The downside is that Corepack itself has had some rough edges historically.

After install, verify with pnpm --version. Upgrade in place with pnpm self-update.

Code

Three install paths·bash
# Path 1 — Homebrew (recommended on macOS)
brew install pnpm

# Path 2 — via npm
npm install -g pnpm

# Path 3 — Corepack (ships with Node.js 16.9+)
corepack enable
corepack prepare pnpm@latest --activate

# Verify + upgrade
pnpm --version
pnpm self-update

External links

Exercise

Install pnpm via Homebrew. Run 'pnpm --version' and 'pnpm store path' to see where the global store will live. Then 'pnpm import' inside an existing npm-managed project to convert package-lock.json to pnpm-lock.yaml — see how clean the migration is.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.