Change8

v12.0.0-rc.6

Breaking Changes
📦 pnpmView on GitHub →
6 breaking7 features🐛 5 fixes🔧 20 symbols

Summary

pnpm v12 introduces robust support for managing and executing other package managers (npm, Yarn, Bun) within projects and via `pnpm dlx`. It also significantly improves Node.js runtime resolution speed and optimizes `pnpm install` performance with `pnprServer`.

⚠️ Breaking Changes

  • Projects previously relying on `pnpm add yarn` to install the npm package named `yarn` will now instead record the project's package manager. To install the npm package, use `pnpm add yarn@npm:yarn@1.22.22`.
  • Globally installing `pnpm add -g yarn` will now install the current Yarn line instead of Yarn Classic.
  • Globally installing `pnpm add -g node` or `pnpm add -g deno` will now install the specified Node.js or Deno release directly, rather than a wrapper package that downloads one.
  • Globally installed package managers will now defer to a project's pinned version where one exists. Previously, the globally installed version was always used.
  • The `packageManager` field in `package.json` now strictly requires an exact version when used with Corepack and Yarn. Previously, ranges might have been accepted.
  • The `devEngines.packageManager` field now holds a range for package managers other than Yarn when pinned via Corepack. Previously, this field might not have been used or might have held different information.

Migration Steps

  1. If you previously used `pnpm add yarn` to install the npm package named `yarn`, switch to `pnpm add yarn@npm:yarn@1.22.22`.
  2. If you relied on globally installed package managers overriding project pins, be aware that project pins now take precedence.
  3. Ensure your Corepack configuration is compatible with exact version pinning for Yarn in `package.json` if you use Yarn.
  4. If you use `pnpm dlx` or `pnx` with package managers, review the updated behavior for specifying versions and runtimes.

✨ New Features

  • Added `pnpm cache path` to display the directory used for pnpm's metadata cache, useful for CI caching.
  • pnpm now installs and manages other package managers (npm, Yarn Classic, Yarn Berry, Yarn 6, Bun), allowing them to be used for dependency preparation and via `pnpm dlx` (`pnx`).
  • Introduced `pnpm shim add yarn` (and similar commands for other package managers) to create symlinks for package manager commands that respect project pins.
  • Globally installed package managers now respect project pins, falling back to the globally installed version if no project pin exists.
  • Added support for `runtime:` specifiers in `devEngines.runtime` for faster Node.js version resolution.
  • Corepack can now run pnpm 12.
  • Improved `pnpm install` performance when a `pnprServer` is configured, including faster repeat installs and skipping unnecessary server exchanges.

🐛 Bug Fixes

  • Corepack could not run pnpm 12 due to missing entry points; this is now fixed by shipping `bin/pnpm.mjs` and `bin/pnpx.mjs`.
  • An install whose `pnpm-lock.yaml` satisfied every manifest would still perform a full server resolve round trip; this is now optimized to materialize `node_modules` from the lockfile locally.
  • The repeat-install fast path with a `pnprServer` configured was not always running; this is now fixed.
  • The input-lockfile verification round trip is now skipped when the local `lockfile-verified.jsonl` cache already covers the lockfile under the current policy.
  • Changing `trustPolicy*`, `minimumReleaseAgeStrict`, or `minimumReleaseAgeExclude` settings previously did not invalidate the repeat-install fast path; this now matches the TypeScript CLI's workspace-state check.

Affected Symbols