pnpm 11.28.6
- A key under a registry URL in the _auth setting that does not start with @ is skipped with a warning instead of causing an error, while a key holding an authToken object but lacking @ is still an error
- Workspace discovery is faster when subtree exclusions such as !generated/** are used
- Frozen installs of unchanged injected workspace packages that use hardlinks are faster
- pnpm accepts httpProxy and httpsProxy set to null or with no value in pnpm-workspace.yaml and the global config file, treating them as unset, which failed with ERR_PNPM_INVALID_SETTING since 11.28.5
- pnpm switches to the pnpm version a project pins even when it cannot read its configuration, so pnpm --version no longer fails on rejected settings
- pnpm no longer drops a dependency that a package also declares as an optional peer dependency, such as ajv for ajv-formats
- pnpm install no longer fails with ERR_PNPM_NO_MATCHING_VERSION after an overrides change when the lockfile resolves an optional peer dependency to an npm alias of another package
- pnpm install and pnpm dedupe link an optional peer to the workspace package the workspace root depends on when the picked version matches, instead of installing the registry package with the same name and version
- Removal overrides such as debug>supports-color set to - now also apply to an optional peer declared only in peerDependenciesMeta
- pnpm dedupe preserves a hoisted workspace package when another package uses a separately installed peer with the same name
- pnpm install and pnpm add --config apply minimumReleaseAge when resolving a config dependency, so a later clean frozen install accepts the lockfile
- pnpm install --fix-lockfile no longer removes the deprecated and hasBin fields from lockfile entries
- A filtered install keeps pnpm-lock.yaml entries of workspace projects missing from disk, including their importers, packages, and catalog entries
- catalogPrune no longer removes catalog entries that pnpm-lock.yaml still records for workspace projects missing from disk, avoiding ERR_PNPM_LOCKFILE_CONFIG_MISMATCH on a following frozen install
- pnpm install no longer fails on Windows with EPERM on rmdir node_modules/@scope when several workspace packages under one scope are hoisted
- pnpm install hardlinks files from a group-writable or world-writable store again instead of copying every file
- With enableGlobalVirtualStore, an install restores dependency links of a package in the global virtual store that an interrupted install left incomplete
- Removing a link: dependency also removes its symlink from node_modules when nodeLinker is hoisted
- An install that adds nothing to the store no longer changes the modification time of the store directory
- With sharedWorkspaceLockfile: false, an injected workspace package holds only the files its files field selects
- A script listed in syncInjectedDepsAfterScripts no longer fails when it rewrites package.json while pnpm copies its edits into injected copies
- pnpm publish now uses an NPM_ID_TOKEN only if its aud claim matches the selected registry, such as npm:registry.npmjs.org
- A token for another registry is skipped with a warning, and pnpm falls back to the configured credentials
- The warning about renamed package files with invalid names no longer prints control characters from those file names
From pnpm
This release stops pnpm publish from sending a CI identity token to a registry it was not issued for. It also fixes installs that dropped a dependency also declared as an optional peer, and accepts empty httpProxy and httpsProxy settings again.
Patch Changes
Security
-
pnpm publishnow uses anNPM_ID_TOKENonly if itsaudclaim matches the selected registry, such asnpm:registry.npmjs.org. A token for another registry is skipped with a warning, and pnpm falls back to the configured credentials. -
The warning about renamed package files with invalid names no longer prints control characters from those file names.
Configuration
-
pnpm again accepts
httpProxyandhttpsProxyset tonullor written with no value inpnpm-workspace.yamland the global config file, and treats them as unset. Since 11.28.5 these values failed withERR_PNPM_INVALID_SETTING. -
pnpm now switches to the pnpm version a project pins even when it cannot read its configuration. Previously, a setting it rejected in the global config file, an
.npmrcfile,_auth, orpnpm-workspace.yamlstopped every command,pnpm --versionincluded. -
A key under a registry URL in the
_authsetting that does not start with@is now skipped with a warning, so a field a later pnpm version adds there no longer breaks this one. A key that holds anauthTokenobject but lacks its@, such asorgfor@org, is still an error.
Resolving dependencies
-
pnpm no longer drops a dependency that a package also declares as an optional peer dependency, for example
ajvofajv-formats. Since 11.28.0, in some dependency graphs the package got the dependency neither as a dependency nor as a peer, and failed to import it #16901. -
pnpm installno longer fails withERR_PNPM_NO_MATCHING_VERSIONafter a change tooverrideswhen the lockfile resolves an optional peer dependency to an npm alias of another package #16654. -
pnpm installandpnpm dedupenow link an optional peer to the workspace package that the workspace root depends on when the picked version matches it. Previously they installed the registry package with the same name and version #16706. -
Removal overrides such as
"debug>supports-color": "-"now also apply to an optional peer that a package declares only inpeerDependenciesMeta#16681. -
pnpm dedupenow preserves a hoisted workspace package when another package uses a separately installed peer with the same name #16935. -
pnpm installandpnpm add --confignow applyminimumReleaseAgewhen they resolve a config dependency. A config dependency range resolves to the newest version that is old enough, so a later cleanpnpm install --frozen-lockfileaccepts the lockfile #16660. -
pnpm install --fix-lockfileno longer removes thedeprecatedandhasBinfields from lockfile entries #6600.
Workspaces and catalogs
-
A filtered install, such as
pnpm install --filter <pkg>, now keeps thepnpm-lock.yamlentries of workspace projects that are missing from disk, as in a sparse checkout. Their importers, packages, and catalog entries stay even when the filter matches every project on disk #16931. -
catalogPruneno longer removes catalog entries thatpnpm-lock.yamlstill records for workspace projects missing from disk. This affectedpnpm removeand installs that leave the lockfile unchanged, such as frozen installs. Before, a following frozen install failed withERR_PNPM_LOCKFILE_CONFIG_MISMATCH#16679. -
Sped up workspace discovery with subtree exclusions such as
!generated/**.
Linking node_modules
-
pnpm installno longer fails on Windows withEPERMonrmdir node_modules/@scopewhen several workspace packages under one scope are hoisted, for example withnodeLinker: hoisted#16690. -
pnpm installhardlinks files from a group-writable or world-writable store again. Before this fix, pnpm copied every file from such a store intonode_modules#16677. -
With
enableGlobalVirtualStore, an install that updatesnode_modulesnow restores the dependency links of a package in the global virtual store that an interrupted install left without them. Before, such an install kept the incomplete package if the project'snode_modulesalready recorded it #16642. -
Removing a
link:dependency now also removes its symlink fromnode_moduleswhennodeLinkerishoisted#16884. -
An install that adds nothing to the store no longer changes the modification time of the store directory. CI caches that check modification times, such as GitLab's, no longer re-upload an unchanged store #16929.
Injected workspace packages
-
With
sharedWorkspaceLockfile: false, an injected workspace package installed in the same run as its dependent now holds only the files itsfilesfield selects. The copy used to also hold other files of the project, such astsconfig.json#16683. -
A script listed in
syncInjectedDepsAfterScriptsno longer fails when it rewritespackage.jsonwhile pnpm is copying its edits into the injected copies. The sync after the script now replaces a half-copied manifest. -
Sped up frozen installs of unchanged injected workspace packages that use hardlinks.
Deploying
-
pnpm deploywithoutinjectWorkspacePackagesnow binds a peer dependency of a linked workspace package to the version its parent provides, as an injected install does. Previously the deploy failed withERR_PNPM_DEPLOY_AMBIGUOUS_PEERwhenever other packages in the deployed graph depended on different versions of that peer #16807. -
pnpm deployin a workspace withinjectWorkspacePackagesno longer crashes when a linked workspace package declares a peer dependency named after anObject.prototypemember, such asconstructor.
Setting up pnpm
-
pnpm now relinks the bins of a pnpm version it installed earlier for
packageManagerorpnpm with. A pnpm 12 version installed by a pnpm release older than 11.28.4 could keep a launcher that rannodeon the native binary, so every command failed withSyntaxError: Invalid or unexpected token#16646. -
pnpm setupno longer tries to install pnpm globally from npm'sbindirectory when pnpm was installed with npm. It printedFailed to create bin at <PNPM_HOME>/bin/pnpm#16855.
Output
-
Escape codes in script output that moved the cursor or cleared the screen garbled pnpm's output. pnpm now drops them and keeps only color codes. Color codes are dropped too when pnpm's own output is not in color.
-
When the registry rejects
pnpm stage publish, the error message now starts with "Failed to stage package".