Node package managers — npm vs pnpm vs yarn vs bun. Why corepack + the packageManager field is the right pinning answer, when to use mise's npm: backend for global CLIs vs project-local deps, and the monorepo story. Use when picking a Node package manager or explaining corepack.
Node has four mainstream package managers: npm, pnpm, yarn, and bun. All four work with any package.json. The right choice is mostly about your workflow, not technical capability.
| Manager | Speed | Disk usage | Monorepo | Lockfile | Default in… |
|---|---|---|---|---|---|
| npm | 🥉 baseline | heavy (duplication) | workspaces (ok) | package-lock.json | ships with Node |
| pnpm | 🥇 fastest | 🥇 content-addressed store | 🥇 built-in workspaces | pnpm-lock.yaml | — |
| yarn (berry) | 🥈 fast | medium | 🥈 workspaces + PnP | yarn.lock |
| — |
| bun | 🥇🥇 fastest | medium | workspaces | bun.lockb (binary) | — |
Never mix two package managers in one project — pick one lockfile and commit only that.
packageManagerSince Node 16.9, corepack ships with Node. It reads packageManager from package.json and shims pnpm / yarn / npm to the exact version specified:
{
"packageManager": "[email protected]"
}
With corepack enable run once, typing pnpm install in the project directory runs pnpm 9.14.2 specifically. No npm install -g pnpm. No drift. No "what version is on CI vs dev".
This is the way to pin package managers as of 2026. Use it.
[tools]
node = "24"
[hooks]
enter = "corepack enable 2>/dev/null || true"
[hooks] enter runs when mise activates the directory — once per shell session entering the dir. corepack enable is idempotent, so running it on every enter is safe. The || true prevents a stale corepack install from breaking the hook.
npm: backendmise has an npm: backend for installing npm packages as global CLIs managed by mise:
[tools]
node = "24"
"npm:typescript" = "5.6"
"npm:prettier" = "3.4"
"npm:@anthropic-ai/claude-code" = "latest"
"npm:vercel" = "latest"
Use npm: for:
npm install -g.~/.config/mise/config.toml).Don't use npm: for:
package.json.# pnpm-workspace.yaml