Skip to main content

pnpm 12.22.0

Release Date: November 17, 2026

Verdict first: pnpm 12.22.0 is worth installing today if you switch registries, run CI installs, or rely on pnpm dlx. I upgraded four workspaces, including one that mirrors a package set between npmjs and a private registry, and the security fix alone justified the bump. Released November 17, 2026, this is a minor release with three feature additions and a long tail of install fixes.

The Security Fix You Should Care About

The release notes lead with it, and rightly so. Before 12.22.0, when the default registry or a scoped registry changed, pnpm install could reuse a resolution cached for the previous registry and skip the minimumReleaseAge and trustPolicy checks against the new one (PR #18070). In practice that means a package you had not yet allowed by release age could slip in after a registry switch. Now lockfile resolutions are re-verified against the new registry, and for registries configured with serverType: pnpr, locked revisions are checked against the registry whenever no cached result applies.

A second fix tightens pnpm dlx (PR #18075). Cached installs made under looser overrides, packageExtensions, minimumReleaseAge, trustPolicy, trustLockfile, or blockExoticSubdeps settings are no longer reused, and a local pnpm-workspace.yaml no longer contributes overrides to a dlx run. Also worth noting: pnpm audit was silently dropping advisories whose id was a string and reporting no known vulnerabilities (issue #18184). That one is fixed, so a clean audit result finally means something again.

Features Worth Using

  • globalPackagesConfig. The global config.yaml now has a section whose settings apply only to commands that act on global packages, such as pnpm add -g and pnpm update -g. A globalPackagesConfig.trustPolicyExclude entry, for example, excludes a package from the trust policy for global installs only, leaving project installs untouched (issue #18130). Build decisions from pnpm approve-builds -g and pnpm add -g --allow-build are now stored under globalPackagesConfig.permissions, and settings still read from the global packages directory's pnpm-workspace.yaml raise a deprecation warning until the next approval migrates them.
  • pnpm why --ranges. The command now lists the version range each direct dependent declares for the package, which is the answer you want when a transitive dependency shows up twice. pnpm why --json carries the same data in a requires field (PR #18121).
  • Dependency-ordered workspace listing. pnpm list --recursive prints workspace projects in dependency order, so build order becomes readable at a glance. Pass --no-sort to keep the old workspace order (issue #7716).
  • Catalog resolution for file dependencies. A file: dependency on a local directory now resolves catalog: specifiers from that directory's package.json against workspace catalogs, the same way an injected package does. Before this, the install failed with ERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER.
  • v13 lockfile recording. In the experimental v13 format, local directory packages record their declared specifiers beside resolved versions, injected dependencies carry injected: true, and the dependenciesMeta field is gone. A lockfile written by an earlier pnpm needs one pnpm install to rewrite it.

Install Fixes I Actually Hit

pnpm ci now validates that pnpm-lock.yaml exists and matches package.json before it removes node_modules, which turns a destructive step into a safe failure. In the same area, pnpm ci and pnpm clean honor --filter, --filter-prod, and --workspace-root, and pnpm clean --lockfile removes per-project lockfiles plus lockfiles in a custom lockfileDir.

CI users also get better failure modes. pnpm approve-builds and pnpm approve without package arguments or --all now fail with explicit ERR_PNPM_APPROVE_BUILDS_NON_INTERACTIVE and ERR_PNPM_APPROVE_NON_INTERACTIVE errors when packages await approval in a non-interactive environment, instead of hanging. pnpm dlx and global installs skip automatic approval prompts in CI and leave the pending builds unapproved.

A handful of resolution bugs also went away. When multiple overrides selectors match a dependency, the narrower version range wins regardless of declaration order (PR #18071). Patches that add lines to a file without a final newline no longer lose the last added line (issue #18156). Optional peers with autoInstallPeers are no longer bound to out-of-range versions pulled in by an unrelated subtree, which used to rewrite peer suffixes across the lockfile (issue #18162). Installs over frozen lockfiles now accept injected workspace packages whose children use link: or bare relative paths.

Upgrade Notes

The bump is a drop-in for 12.x projects. My four workspaces installed without lockfile churn, aside from the experimental v13 one, which rewrote as documented. The only behavior change to watch is the new CI exit codes for unapproved builds, which can fail pipelines that previously passed by skipping approval silently.

corepack use [email protected], npm install -g [email protected], or your standalone installer of choice will do it. If you run a private registry next to npmjs, this is the release to take.

Other Versions

We use cookies for ads and analytics.