Update pnpm to v12.23.0 #336
Loading…
Reference in a new issue
No description provided.
Delete branch "renovate/pnpm-12.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
12.21.0→12.23.0Release Notes
pnpm/pnpm (pnpm)
v12.23.0: pnpm 12.23Compare Source
This release adds
pnpm edit,pnpm catalog migrate, andpnpm link --hard, and moves deprecation warnings into the install summary. Platform variants are removed, so packages that publish them need to move tooptionalDependencies. It also carries security fixes: pnpm no longer readsotpfrom config files, and it sends registry credentials only over HTTPS.Minor Changes
Packing and publishing
Removed platform variants. A package version has one archive again.
pnpm no longer reads
publishConfig.variantsor thevariantfield ofpackage.json.pnpm pack --variantand the--upload-variant,--variant-integrityand--no-variantsoptions ofpnpm publishare gone. pnpr no longer accepts variant archives with a version or serves them at<name>@<version>/variants/<tag>.To ship builds for several platforms, publish each as its own package and list them in
optionalDependencies. A frozen install of a lockfile that records the variants of a registry package fails withERR_PNPM_BROKEN_LOCKFILE. Runpnpm installto resolve the lockfile again.pnpm packandpnpm publishnow fail if a package that is not private lists a private workspace package independencies. A private package is never published, so the published package could not be installed.devDependencies,optionalDependencies,peerDependencies, and bundled dependencies are still allowed #2321.pnpm publishnow supports--new-version <version>, which sets the version inpackage.jsonbefore publishing. With--recursive, every selected workspace package is set to the new version #2168.pnpm pack --jsonnow reports thepackage.jsonthat goes into the tarball, withpublishConfigand the other publish-time changes applied. Runpnpm pack --dry-run --jsonto preview it without writing a tarball. A dry run still runsprepackandprepare, unless--ignore-scriptsis passed.pnpm packandpnpm publishnow add a workspace-rootCOPYINGfile to a workspace package that has no license file. ACOPYINGfile at the package root now counts as the package's license, so the workspace-rootLICENSEis no longer added next to it.Added the
versioning.includePrivatePackagessetting. Set it tofalseto leave private packages out ofpnpm change#13813.Managing dependencies
Added the
pnpm editcommand to open an installed package directory in an editor.Added
pnpm catalog migrate, which moves dependency specifiers into the default catalog and replaces them in the workspace projects'package.jsonfiles withcatalog:. A dependency moves only when every project declares it with the same specifier. The command lists the dependencies it leaves unchanged #7072.Added a
--hardoption topnpm link. With--hard, pnpm saves the linked package with thefile:protocol, so its files are hard linked intonode_modulesand its dependencies and peer dependencies resolve from your project.pnpm unlinkremoves these links too #9895.pnpm removenow accepts glob patterns and!exclusions in dependency selectors, such aspnpm remove "eslint-*" "!eslint-plugin-import"#13546.When pnpm updates a
package.json5, it now changes only the values that changed. Comments, quotes, number formats, and layout elsewhere in the file stay as written. New keys and strings use the quote style of the file.nodeLinkeraccepts object settings for isolated and hoisted installs. Linker-specific hoisting options can be configured alongside the selected linker.Updating dependencies
pnpm update --latest <pkg>now moves the override that pins the named dependency #8701.pnpm update --interactive --latestdoes the same for every selected dependency. An override keeps its own range shape: a pin on an exact version lands on the new exact version, and^stays^. When pnpm cannot update the governing override automatically, the update prints a warning naming it.pnpm updatenow accepts--tag <tag>. The flag updates the matched dependencies to the version behind the given dist-tag and rewrites the ranges inpackage.json, the way--latestupdates to thelatesttag. It also works with--interactiveand with global updates #3534.With
trustPolicy: no-downgrade,pnpm update --interactiveshows aTrustcolumn with the trust evidence of each offered registry dependency #8889. The list also offers only versions the trust policy accepts, so it matches what the update installs.pnpm update --interactive --longshows the homepage or repository URL of each package. The URL column is hidden without--long.Release age and build settings
Added the
referenceTimesetting.minimumReleaseAgeandtrustPolicyIgnoreAftercount back from this RFC 3339 time, both when pnpm resolves versions and when it verifies a lockfile. Set it inpnpm-workspace.yamlor withPNPM_CONFIG_REFERENCE_TIME.Added the
--minimum-release-ageand--minimum-release-age-excludeoptions topnpm install,pnpm add,pnpm update, andpnpm dlx. They setminimumReleaseAgeandminimumReleaseAgeExcludefor a single run without editing a config file #11224.pnpm audit --fixaccepts--no-add-release-age-exclusions, which applies the fixes without adding entries tominimumReleaseAgeExclude.--allow-buildnow accepts a comma-separated list of packages, sopnpm add foo bar --allow-build=foo,baris the same as passing--allow-build=foo --allow-build=bar#9560.Install output
Deprecation warnings moved into the install summary and only name the packages the install added. A deprecated dependency added by the install is marked
deprecatedon its summary line, with the version that is not deprecated when there is one. Deprecated subdependencies the install added are listed right after the summary. Deprecated packages that were already installed are reported as one count, such as3 deprecated packages are still installed.In a workspace, the install summary now lists the direct dependency changes of every project, not only of the project pnpm runs in. Each change is listed once, followed by the projects that made it, unless only the current project did. A project's first install lists only deprecated or outdated dependencies and the ones the command added #6481.
pnpm installnow warns when an entry inoverridesmatches no dependency, in a single line such as2 overrides matched no dependency: foo, parent>child. Only the overrides declared in the workspace are checked. Overrides added by a config dependency or anupdateConfighook are not. SetwarnUnusedOverrides: falseto turn the warning off #10315.pnpm installnow shows lockfile verification progress while the supply-chain check runs. The final pass or failure line reports how many entries were checked.Setup and diagnostics
pnpm doctornow checks the environment that lifecycle scripts run in. It lists thenodeexecutables onPATHand warns about broken ones. It reports the shell that runs scripts. A new check runs a package's executable from a script, both in a temporary project and in the current project. If that script fails, the report includes the error and, outside Windows, a trace of the executable's shim that shows how it looked up and startednode#16308.pnpm self-update,pnpm setup, and the "Install method" check ofpnpm doctornow warn when anotherpnpmonPATHwould run in place of the one pnpm installed. The warning names that copy. If pnpm recognizes how it was installed (npm, Homebrew, Corepack, Volta, or Scoop), the warning also gives the command that removes it.Set
PNPM_CONFIG_HOMEto choose the directory containingconfig.yamlandauth.ini. Global configuration commands read and write files in this directory. A non-empty value takes precedence overXDG_CONFIG_HOMEand the platform defaults.pnpm now provides a prebuilt binary for Linux on LoongArch (loong64) with glibc.
A failed
devEngines.runtimeorengines.runtimecheck now reports the reason in its error code. A runtime that is not installed fails withERR_PNPM_RUNTIME_NOT_FOUND. A runtime entry without a version range fails withERR_PNPM_MISSING_RUNTIME_VERSION_RANGE, and one with an invalid range fails withERR_PNPM_INVALID_RUNTIME_VERSION_RANGE. An installed version that does not satisfy the range still fails withERR_PNPM_BAD_RUNTIME_VERSION.pnpm view <pkg>now prints the registry it read the metadata from at the end of the summary #11394.Patch Changes
Security
otpis no longer read from any config file. Pass--otpon the command line, or setPNPM_CONFIG_OTP. Apnpm-workspace.yamlor a globalconfig.yamlthat carriesotpis ignored, with a warning naming those two channels.pnpm config set otpfails withERR_PNPM_CONFIG_SET_NOT_A_FILE_SETTING.This closes a way to leak a secret. A repository could write
otp: ${NPM_TOKEN}beside its ownregistry:, andpnpm publishsent that environment variable to the registry the same file named, in thenpm-otpheader of its first request #13542.pnpm now sends registry credentials only over HTTPS or loopback HTTP, both for tarball downloads and for requests to
pnprServer. Tarball and package metadata requests respect registry credential paths on redirects. A failed tarball request can no longer pin its redirect destination in the lockfile.pnpm installnow rejects local filesystem dependencies (file:,link:, and path-basedworkspace:specifiers) declared by non-local packages withERR_PNPM_LOCAL_SUBDEP_NOT_ALLOWED. Relativefile:dependencies inside a package's own archive and local dependencies configured by the workspace throughoverrides,packageExtensions, or.pnpmfile.cjscontinue to work. Lockfile verification also rejects unauthorized local directory, tarball, and link entries on non-importer snapshots.pnpm installandpnpm install --frozen-lockfilenow enforceblockExoticSubdepsagainst entries inpnpm-lock.yaml. Before, pnpm accepted a lockfile with git or tarball URL subdependencies and installed those packages even withblockExoticSubdeps: true.pnpm installwithpnprServernow rejects registry-keyed lockfile entries whose resolution uses a non-registry source withERR_PNPM_RESOLUTION_SHAPE_MISMATCH. Thepnprlockfile verification and resolution endpoints enforce the same check before accepting or caching a lockfile.pnpm dlx,pnx, andpnpm createnow ignore local configuration in the working directory. This covers.pnpmfile.cjshooks, proxy and TLS settings in the project.npmrc, and execution, layout, and resolution settings in a localpnpm-workspace.yaml, includingpnpmfile,globalPnpmfile,configDependencies,scriptShell,cacheDir,storeDir, andignoreScripts. Settings from the user's globalconfig.yaml, such asblockExoticSubdeps,cacheDir, andstoreDir, remain active.Global commands (
--global,-g) no longer load.pnpmfile.cjs,pnpm-workspace.yaml, or.npmrcfrom the current working directory.pnpm why -gnow inspects globally installed packages.pnpm config getrefuses to print protected auth settings.pnpm config listhides TLS private keys and inline proxy credentials.pnpm config set --global tokenHelperwrites toauth.ini, and setting a project-leveltokenHelperfails.TLS file paths in
.npmrcandauth.iniresolve relative to the file that declares them. Project.npmrcfiles skip TLS file paths containing environment variables.When the
pnpmpackage downloads its native binary on first run, it now handles registry credentials the way pnpm does://registry.example.com/org-a/npm/:_authToken, are sent only to that path. They were sent to any path on the same host.auth.ini, wherepnpm loginwrites them, and from the_authsetting of the globalconfig.yaml.${NPM_TOKEN?}placeholder in.npmrcexpands to the variable. It expanded to an empty value, so the download was sent without credentials.Matching a glob that repeats a wildcard, such as
+(*)zin the workspacepackagespatterns, no longer hangs on long paths. The bundled picomatch is patched for a security advisory.pnpm packandpnpm publishnow rejectpublishConfig.directoryvalues that use an absolute path or..segments outside the package directory.The
pnpmbinary no longer depends onchrono, which RustSec reports as unmaintained in RUSTSEC-2026-0543.Installing packages
pnpm installnow adds a new workspace package that has no dependencies to theimportersofpnpm-lock.yaml#18189.With
enableGlobalVirtualStoreon,require.extensionshooks run again forrequire()calls from a module compiled from a string, such as the module Next.js uses to loadnext.config.ts. A required.tsfile skipped the registered TypeScript hook. A required.jsonfile was parsed as JavaScript #18261.On Windows, when the project is on a network share,
pnpm installnow links dependencies innode_moduleswith the kind of link that can be opened on that share. It tries a junction first and a symlink second. If neither can be opened, the install fails with advice.On Windows, concurrent installs that link the same dependency no longer leave an
.ignored_<name>entry next to the link in the global virtual store.pnpm installnow fails withERR_PNPM_UNSUPPORTED_PROTOCOLwhen afile:dependency that is not a workspace project uses acatalog:specifier. Injected workspace projects still resolve theircatalog:dependencies.A
link:or relative-path dependency of a local directory dependency now resolves from that directory. In any other package, such as a local tarball, it resolves from the lockfile directory. Both used to resolve from the importing project's directory pnpm/tasks#319.Two workspace projects that declare the same injected relative-path dependency, such as
../child, no longer share the directory the first one resolved.pnpm installnow links a workspace package for aworkspace:range that combines^,~, or*with other ranges, such asworkspace:^ || ^2.0.0.Fixed
pnpm installkeeping a runtime binary for the previous platform after a change tosupportedArchitectureswith the global virtual store disabled.The
nodeVersionsetting no longer changes the global virtual store directory names or the side-effects cache keys. These follow the Node.js runtime that pnpm installs for the project, then thenodeonPATH.pnpm licensesandpnpm store statusnow find packages that an install withnodeVersionplaced in the global virtual store.Fixed package maps resolving workspace and linked packages to the wrong directory when a path contains
#,?, or%.pnpm installandpnpm peers checkno longer report acatalog:peer of an injected workspace package as unmet when the installed version matches the catalog entry #10279.The peer dependency check now reads the version of an injected workspace package from its
package.json.pnpm installwithstrictPeerDependencies: trueandpnpm peers checkno longer report such a peer as unmet with afile:version.With
sharedWorkspaceLockfile: false,pnpm installnow reports missing peers of linked workspace packages, aspnpm peers checkdoes.peerDependencyRules.allowedVersionsnow accepts a parent version range that contains>, such as"foo@>=1.0.0>bar": "1".Fixed
nodeLinker: hoistedinstalls in a workspace where the directory of one project is inside the directory of another. A dependency of the inner project could resolve to the version in the outer project'snode_modules. pnpm now keeps the inner project's dependency in its ownnode_moduleswhen the outer project holds another version.With
nodeLinker: hoisted, pnpm now finds the agent skills of a dependency whose directory is shared with another peer variant of the same package version.pnpm installwithpnprServerset now handles more workspace settings:injectWorkspacePackages,dedupeInjectedDeps,ignoredOptionalDependencies, anddependenciesMeta. Projects that use them no longer fail withERR_PNPM_OUTDATED_LOCKFILEorERR_PNPM_LOCKFILE_CONFIG_MISMATCH.pnpm install --update-checksumsrefreshes the integrity checksums in the lockfile.minimumReleaseAgeStrictand adds fallback versions tominimumReleaseAgeExcludewhen strict mode is off.file:,link:, or local path dependencies, or whenblockExoticSubdepsisfalse.pnpralso rejects local filesystem dependency specifiers on/-/pnpr/v0/resolve.When an overrides entry requests a version that does not exist on the registry,
pnpm installnow names that override entry in the error. If the entry's selector has a version range, such asfoo@^1, the error also shows the latest published version in that range.pnpm addrun from a workspace package directory that has nopackage.jsonyet now suggests creating one withpnpm init#11345.The install summary now shows "(X is available)" after a direct dependency whose
latestversion on the registry is newer than the one installed. The note appears when the install resolved that dependency against registry metadata.Approving the
minimumReleaseAgeprompt no longer reprints the list of packages it just showed. pnpm now confirms with one line that says how many entries it added tominimumReleaseAgeExclude#15377.pnpm now prints a warning that explains why it has to remove and recreate a modules directory.
pnpm installwithnodeLinker: hoistedno longer hangs or runs out of memory in large workspaces whose packages are installed with many different sets of peer dependencies.Sped up
pnpm installon macOS for packages installed with several sets of peer dependencies. pnpm now clones every peer variant of a package from one cached copy of its files.Sped up linking bins in large workspaces. pnpm now reuses a workspace package's
package.jsonacross the projects that depend on it when linking their bins.pnpm install --frozen-lockfileno longer waits for a Node.js version check it does not use before it exits. With Homebrew's Node.js, a frozen install with nothing to do can be about 3x faster.Resolving a remote tarball uses the download response directly, saving a request.
pnpm in StackBlitz WebContainers sends HTTP response bodies and subprocess output to its engine as raw bytes. A 64 KiB chunk no longer becomes a 234 KB message pnpm/tasks#63.
Lockfile
Fixed
pnpm installfailing withERR_PNPM_NEXT_LOCKFILE_NOT_REPRESENTABLEunderlockfile.format: v13when a peer dependency is provided by an aliased package and another alias installs the package that has the peer's name #18198.Fixed writing v13 lockfiles when a package has an ordinary npm alias of one of its direct or transitive peers #18274.
Fixed conversion to the v13 lockfile format when a hashed peer suffix includes a workspace link and the package installs its own copy of another declared peer #18288.
pnpm installnow converts an existing lockfile when you changelockfile.format, even when all dependencies are already installed. Withlockfile.format: v13, an install that updates a v9 lockfile without resolving, for example after a dependency is removed, now writes the v13 format.A lockfile in the experimental
v13format now always recordsautoDedupe,dedupeInjectedDeps,dedupePeerDependentsandlinkWorkspacePackages, aslockfile.includeResolutionSettingsdoes for thev9format. Afterpnpm install --frozen-lockfilewithautoDedupe,pnpm runno longer starts another install. Runpnpm installonce to record the settings in av13lockfile written by an earlier version, sincepnpm install --frozen-lockfilefails on it #16583.pnpm install --frozen-lockfilenow checks the dependencies of local directory dependencies against the lockfile more closely. It fails when theinjectedsetting of such a dependency no longer matches the lockfile pnpm/tasks#319. It accepts a plain-range dependency thatlinkWorkspacePackages: deeplinked to a workspace project.Frozen installs now detect changes to catalog entries used only by peer dependencies of local directory packages.
Frozen installs now restore links declared through catalogs when
excludeLinksFromLockfileis enabled.pnpm install --frozen-lockfilenow revalidates registry metadata when verifying a locked tarball whose version is missing from the cached package listing.During dependency filtering in commands such as
pnpm install --prod --frozen-lockfile, pnpm now recovers hashed peers in v9 lockfiles only when a binding can affect which dependencies are kept #18276.Fixed
pnpm install --lockfile-onlyfetching a locked transitive Git dependency when an unrelated dependency changes #18217.Fixed
pnpm fetchfailing when a Docker build copies the lockfile before the workspace configuration or pnpmfile.pnpm-lock.yamlnow quotes strings that look like numbers, such as+.5, so they are read back as strings.Build approvals
pnpm approve-builds --allandpnpm approve --allno longer approve a package whose build is denied withfalseinpnpm-workspace.yaml.A
<pkg>@<version>: falseentry inallowBuildsorpermissionsnow also blocks<pkg>@<version>from a named registry, including whendangerouslyAllowAllBuildsis set.pnpm add --allow-buildnow records its decision underpermissionswhenpnpm-workspace.yamlhas apermissionssetting. Before, a--allow-build=!<pkg>denial went toallowBuildsand was overridden by an existingpermissions.<pkg>.build: true.pnpm approve-buildsnow requires the exact selector shown bypnpm ignored-buildsfor a dependency a bare package name cannot identify (afile:, git, or tarball artifact). A bare package name only approves a plain registry version #18237.pnpm approve-builds,pnpm approve, andpnpm add --allow-buildnow refuse to edit a package'spermissionsentry written as an inline mapping that spans several lines. Before, they added a second key for the package topnpm-workspace.yaml.Install now reports packages awaiting build and skill approval in one notice. Approval prompts and notices show a package from a named registry by its name. They no longer label it as a tarball.
Running scripts and tasks
Fixed
pnpm runhanging after an interrupt:pnpm runandpnpm execno longer trigger a reinstall solely because the last install used--trust-lockfile#18218.The workspace project graph now follows
overrides. An override that points a dependency at a workspace package, such asfoo: workspace:*, makes that package a dependency of every project whose declaration the override matches, even withlinkWorkspacePackagesoff.pnpm installnow runs that package's lifecycle scripts before the scripts of the projects depending on it.pnpm -r runorders the projects the same way.--filterselectors that follow dependencies now see the edge.A
[<since>]filter such as--filter "...[origin/main]"now selects a project whose dependency anoverridesentry points at a changed catalog entry. For example, withlib: catalog:localinoverrides, changinglibin thelocalcatalog selects every project that depends onlib.When
sharedWorkspaceLockfileisfalse,pnpm installnow runs the workspace root'spnpm:devPreinstallscript once, before any project is installed, including when a filter excludes the root. Workspace members no longer run theirs #4503.Recursive runs honor
--sequentialwith--parallel, and changed-file ignore patterns support negation.pnpm list -r --no-sort --reversereverses the selected project order.pnpm cleanforwards positional arguments to a project's clean script.--resume-fromstarts at the named project when the previous run completed no tasks.pnpm pipelinefixes:--env-file,extraEnv, orNODE_OPTIONSchange, or when the script shell settings change.!exclusions.--filterand--filter-prod, includes untracked files when selecting affected projects, and runs the prerequisites of tasks matched by regex selectors.fingerprintor.fingerprintdirectory in a nested Cargo build.With
shellEmulator: true, parameter expansions such as${MODE:-dev}now see assignments made earlier in the script.Plug'n'Play fixes:
require.resolve()lookup paths.NODE_OPTIONSand command-line flags, and respects Node.js's enablednode-addonsandmodule-syncconditions.pnpm runandpnpm exec, including recursive runs, find the loader and the experimental package map whenlockfileDiris configured.pnpm installrecreates a deleted.pnp.cjsloader, and a fullpnpm cleanremoves the generated loader.After a workspace script runs, pnpm links commands from scoped injected packages into the containing modules directory's
.bin. Commands declared throughdirectories.binare also refreshed.Refreshing injected dependencies preserves the install's
NODE_PATHsettings in command shims and respects workspace package exclusions.pnpm recognizes uppercase file extensions when choosing the interpreter for commands without a shebang. It skips hidden files and directories when linking commands from
directories.bin.pnpm dlx,pnx, andpnpm createnow handle script skipping and non-registry package specifiers consistently:--ignore-scriptsorignoreScripts: trueuses a separatedlxcache key, keeping cached installs that skipped build scripts separate from normal runs../my-cliand./my-cli.tgzresolve against the caller's working directory.file:, and git URL packages run their build scripts by default unless--ignore-scriptsor a negated--allow-buildselector disables them.A
tasksentry with no value inpnpm-workspace.yaml, such asbuild:, now fails with a hint. The hint suggests writing{}for a task with no settings, or removing the entry to keep the defaultdependsOn: ['^<task>'].Python and Cargo
pnpm installnow locks Cargo path dependencies outside the workspace, as Cargo does. It failed withworkspace dependency <name> is not a workspace member.pnpm install --frozen-lockfilenow also fails whenCargo.lockmisses a path dependency or locks a git dependency at another branch, tag, or revision.pnpm outdatedandpnpm updatenow include Cargo dependencies declared under[target.<cfg>.dependencies].pnpm update --prodno longer fails on a crate that is also a dev-dependency.pnpm add crate:fails in a virtual Cargo workspace root, ascargo adddoes. It added a[dependencies]table that Cargo rejects there.pnpm removeaccepts Python and Cargo package specifiers. Recursive and filtered updates include standalone Python and Cargo workspace members.pnpm updateandpnpm outdatedmatch normalized Python names and Cargo aliases.pnpm installnow skips a Python project that has only arequirements.txtwhen its directory has a.venvthat pnpm did not create, and prints a warning. The install failed for the whole workspace before.Fixed Python wheel installs with legacy metadata, whitespace around entry point targets, and interpreter options in script shebangs.
Python dependency groups now match normalized names. Adding a development dependency reports when the project excludes the dev group.
Comments ending in a backslash in
requirements.txtno longer hide the next requirement.pnpm execfinds the environment of requirements-only projects under a tool-onlypyproject.toml.Fixed
pnpm addandpnpm updatein shared Python workspaces that contain a requirements-only member.Fixed
pnpm updatefailing with a TOML parse error whenpyproject.tomldeclares[project.optional-dependencies].pnpm store pruneno longer removes files of the wheels that an installed Python project uses, sopnpm install --offlinecan recreate its environment. Pruning now also removes the store index entries of Python and Cargo archives whose files it deleted.Updating, auditing, and publishing
pnpm auditnow checks tarball, git, and named-registry dependencies against security advisories.pnpm audit signaturesnow verifies packages installed from named registries and skips non-registry dependencies.pnpm auditnow checks patched versions correctly when registry metadata includes anunpublishedentry in itstimefield #18209.pnpm audit --fix=truenow applies the default override fix method, like a barepnpm audit --fix#13261.pnpm outdatednow reports newer prereleases of an installed prerelease. It checks the dist-tag that points to the newest version of the installed prerelease channel, such asnextfor3.0.0-rc.0, alongsidelatest#7339.Fixed
pnpm updateandpnpm outdatedmatching every dependency of an ecosystem when a positive selector is combined with a negated package selector such as!lodash. This applied to Cargo, Python, npm, and--include-github-actionsselectors.Fixed
pnpm updateandpnpm outdatedwith--include-github-actionscorrupting workflow YAML or skipping actions referenced through YAML anchors, aliases, or merge keys.pnpm addandpnpm updatenow keep the range operator of a specifier that has both a prerelease and a build suffix, such as^1.0.0-next.0+build.1.pnpm dedupe --checkno longer requests the registry metadata of locked versions that the cache already holds.pnpm dedupeskips those requests too whenlockfile.formatisv13, which records nodeprecatednotices. Both were slow against a registry that sends noETagorLast-Modified, such as Azure Artifacts, where each request downloaded the full package metadata #17758.pnpm publishnow readsaccessandtagfrompnpm-workspace.yaml, the globalconfig.yaml, andPNPM_CONFIG_ACCESS/PNPM_CONFIG_TAG. The--accessand--tagflags still win when set. A configuredaccessoutrankspublishConfig.access. An emptypublishBranchnow allowsmasterandmain#13542.pnpm packandpnpm publishfixes:publishConfig.name.package.yamlorpackage.json5manifest are packed correctly, and these packages include their parked changelog.beforePackingis validated and normalized.pnpm versionfixes:1.2.3fooor01.2.3. It used to set a normalized version that differed from the argument.--preid.pnpm version -rupdates explicit workspace dependency ranges that a release invalidates.preversionscript makes to other manifest fields.When
pnpm unpublishremoves the version taggedlatest, it prefers the highest remaining stable version.pnpm stageuses the current package's publish registry when listing, viewing, approving, rejecting, or downloading staged versions. To use a one-time password at a non-default registry selected by the package, pass--registry.Fixed several bugs in patching dependencies:
diff --gitlines now applies.ERR_PNPM_INVALID_PATCH. Before, pnpm wrote the symlink as a regular file.pnpm patch-commit --patches-dir ../outsidenow fails withERR_PNPM_PATCHES_DIR_OUTSIDE_PROJECT. Before, pnpm wrote the patch tooutsideinside the project.pnpm patch-commitkeeps a file without a final newline unterminated when that file comes last in the patch. Before, the patched file gained a trailing newline.pnpm patch-commitkeeps the peers a patched package is bound to in the lockfile. It no longer fails withERR_PNPM_NEXT_LOCKFILE_NOT_REPRESENTABLEwhen the package has an optional peer andlockfile.formatisv13.patchedDependenciesentry now records its patch hash on afile:directory dependency or an injected workspace package.pnpm install --frozen-lockfileno longer fails withERR_PNPM_INCONSISTENT_PATCH_HASHon the lockfile thatpnpm installwrote.pnpm patchandpnpm patch-commitfind a package installed from anamedRegistriesalias by its version. For example,pnpm patch foo@1.0.0patches a dependency declared aswork:1.0.0.pnpm patch-removeremoves the corresponding edit directory and state entry fromnode_modules/.pnpm_patches.Other commands
Global packages fixes:
pnpm add -gwith several space-separated packages lists every installed package in its summary. Only the packages of the first one were listed.pnpm list -gwith--depthgreater than0always reads the global install directory'snode_modulesand lockfile. It could read the current project's lockfile or a custommodulesDir.pnpm add -g,pnpm update -g, andpnpm outdated -guse the_authandnpmrcAuthFilesettings underglobalPackagesConfigin the globalconfig.yaml.dangerouslyAllowAllBuildsset at the top level of the globalconfig.yaml. pnpm ignored it for global packages unless it was set underglobalPackagesConfig.Fixed
pnpm deployfor projects that depend on an external directory throughlink:.pnpm deploynow also resolves relativefile:overrides from the source workspace #18191.Fixed
pnpm linkfor target manifests without a name. The command uses the directory name and normalizes relative paths written to the manifest. It also resolves a quoted~/path from the home directory.Fixed
pnpm pruneleaving extraneous package links in hoisted installations, andpruneDirectDependenciesskipping cleanup when the lockfile was already up to date.pnpm importfixes:sharedWorkspaceLockfileis disabled andlockfileDiris unset.disallowWorkspaceCyclesand the symlink policy for the destination lockfile.pnpm store addnow fails if it cannot write a package to the store index, for example when another process holds the index locked. It also indexes tarball URLs that have no integrity value #18194.pnpm store prunenow fails withERR_PNPM_FROZEN_STORE_WRITEwhenfrozenStoreis enabled. It used to remove files from the store.Store and cache inspection fixes:
pnpm cache list,view, anddeletesearch across registries by default and recognize mixed-case package names. Pass--registryto restrict them to one registry.pnpm cat-filecan read executable files from the store.pnpm find-hashreports an unknown hash when the store is empty.--jsonwrite errors to stdout.pnpm cleanremoves custom virtual stores with hidden directory names.pnpm list --lockfile-only --find-bynow reads manifests from the configured store whennode_modulesis absent, andpnpm licenses listreads cached package metadata and license files.pnpm list --jsonnow reports unsaved dependencies from each workspace project's own modules directory #18248.pnpm why --exclude-peersnow leaves out packages that are reached only as a resolved peer dependency. The flag was accepted but ignored.pnpm sbomnow assigns workspace dependency relationships consistently across runs.pnpm now fails with
ERR_PNPM_CONFIG_UNRESOLVED_ENV_VARwhen a setting inpnpm-workspace.yamlor the globalconfig.yamlreferences an unset or empty environment variable without a fallback. A string setting used to get an empty string in its place #10963.--config.<name>options now validate their values.--config.storeDirand--config.stateDirwork like--store-dirand--state-dir. An empty--state-dir=resets to the default state directory, as--store-dir=does.noProxyinpnpm-workspace.yamlor the globalconfig.yamlnow fails validation unless it is a string or a boolean.nullleaves the setting unset.pnpm doctorchecks the resolved global bin directory onPATH.pnpm --versionnow succeeds when the project pins another package manager.Fixed pnpm dropping Ctrl+C just before launching its native binary through Corepack or Node.js on Unix #18222.
The pnpm npm package provides bundled node-gyp to lifecycle scripts even when pnpm's own install scripts were skipped #18227.
The pnpm binary is about 16% smaller on Linux and macOS.
Tab completion suggests project scripts when you type
pnpmfollowed by a script name #18239. Shell completion uses the cursor position when editing an existing command.The help for
pnpm config getandpnpm getnow says that the key is a property path, such ascatalog.react.Removed the obsolete
xmascommand.Platinum Sponsors
Gold Sponsors
v12.22.0: pnpm 12.22.0Compare Source
pnpm 12.22.0 adds a
globalPackagesConfigsection to the globalconfig.yamlfor settings that apply only to global packages, addspnpm why --ranges, and lists workspace projects in dependency order inpnpm list --recursive. It also includes a security fix. After the default or a scoped registry changed,pnpm installcould skip theminimumReleaseAgeandtrustPolicychecks against the new registry.Minor Changes
Settings under
globalPackagesConfigin the globalconfig.yamlnow apply only to commands that act on global packages, such aspnpm add -gandpnpm update -g. For example,globalPackagesConfig.trustPolicyExcludeexcludes a package from the trust policy for global installs only #18130.pnpm approve-builds -gandpnpm add -g --allow-buildnow save build decisions underglobalPackagesConfig.permissions. pnpm still applies build settings from thepnpm-workspace.yamlof the global packages directory, with a deprecation warning. The next approval moves them toconfig.yaml.Added
pnpm why --ranges, which lists the version range that each direct dependent declares for the package.pnpm why --jsonnow includes the declared range of each dependent in arequiresfield #18121.pnpm list --recursivenow lists workspace projects in dependency order. Use--no-sortto retain workspace order #7716.A
file:dependency on a local directory now resolvescatalog:specifiers in that directory'spackage.jsonagainst the workspace catalogs, as an injected workspace package does. Before, the install failed withERR_PNPM_SPEC_NOT_SUPPORTED_BY_ANY_RESOLVER.A
file:dependency on thepublishConfig.directoryof a project is now described by that project'spackage.json, as an injected workspace package is. Apackage.jsonthat a build writes into that directory no longer changes the resolution.The experimental
v13lockfile format records a local directory package's declared specifiers in itsdependenciesandoptionalDependencies, beside the versions they resolved to. A dependency markedinjectedindependenciesMetahasinjected: true. The format no longer has adependenciesMetafield. Runpnpm installto rewrite av13lockfile that an earlier pnpm wrote.Patch Changes
Security
pnpm installnow re-verifies lockfile resolutions when the default registry or a scoped registry changes. Before, it reused the result cached for the previous registry and skipped theminimumReleaseAgeandtrustPolicychecks against the new one #18070.For a registry with
serverType: pnpr,pnpm installalso verifies locked package revisions against the registry when no cached result applies.pnpm dlxno longer reuses a cached install made under looseroverrides,packageExtensions,minimumReleaseAge,trustPolicy,trustLockfile, orblockExoticSubdepssettings. It also no longer appliesoverrides,packageExtensions, orblockExoticSubdepsfrom a localpnpm-workspace.yaml#18075.pnpm dlx --allow-build=!<pkg>now denies build scripts for<pkg>, including the executed package itself. Denied packages also skip interactive build approval.pnpm auditnow reports advisories whoseidis a string. Such advisories were dropped, andpnpm auditreported no known vulnerabilities #18184.Installs that failed
When the
pnpmpackage downloads its native binary on first run, it now reads a globalconfig.yamlthat holds only blank lines or comments as no settings. Such a file made every command fail with "expected a document, but the input is empty" #18172.When the
pnpmpackage downloads its native binary on first run, it now works with registries that serve no per-version package documents, such as Azure Artifacts. If such a registry also removed npm's signatures, pnpm fetches them from registry.npmjs.org. The binary still comes from the configured registry and is checked against npm's signature.Fixed an offline install failing the
minimumReleaseAgelockfile check withERR_PNPM_NO_OFFLINE_METAafter an online install resolved the same packages with the same cache directory. The check now reads publish times from the metadata that the resolution cached #18063.pnpm installno longer runsgit ls-remotefor a git dependency whose specifier is unchanged and whose commit the lockfile already records. Installs that update the lockfile, such as Renovate's, no longer fail without git credentials when the project has a private git dependency with peer dependencies #18104.npm:<pkg>@<range>and named-registry package aliases with space-separated comparators, such asnpm:bar@>=1.0.0 <2.0.0, now resolve the target package #18169.pnpm installwithlockfile.format: v13no longer fails withERR_PNPM_NEXT_LOCKFILE_NOT_REPRESENTABLEwhen it converts av9lockfile in which a package with many peers has a hashed peer suffix and is in a dependency cycle with one of its peers #18148.pnpm deploy --prodnow succeeds withlockfile.format: v13when a production package's optional peer is provided only by development dependencies. The excluded provider stays out of the deployed project #18117.pnpm deploynow preserveslockfile.formatandlockfileIncludeTarballUrlin the deployedpnpm-workspace.yaml. Previously, commands such aspnpm dedupe --checkin a deployed project usinglockfile.format: v13treated the lockfile asv9and reported changes.Fixed
pnpm install --merge-git-branch-lockfiles --frozen-lockfilefailing withERR_PNPM_OUTDATED_LOCKFILEwhen a project sets or removespublishConfig.directory,publishConfig.linkDirectory, ordependenciesMeta. Lockfile merging now preserves and reconcilespublishDirectory,linkDirectory, anddependenciesMetaon importers.Frozen installs accept injected workspace packages whose child dependencies use
link:or a bare relative path pnpm/tasks#274.Installing an injected local package no longer fails with a "no such file or directory" error when another process renames or removes files in that package while pnpm lists them. This happened most often on macOS in workspaces with
sharedWorkspaceLockfile: false, where the install of the package itself writes its lockfile at the same time.Fixed a crash when
pnpm-lock.yamlor a dependency selector contains a package name that starts with a multi-byte UTF-8 character.Tarball URLs that reject HEAD requests with 405 Method Not Allowed now fall back to a GET request during resolution.
Resolving and linking dependencies
With
autoInstallPeers, an optional peer is no longer bound to a version outside its range that only another dependency's subtree brings in. Before, adding an unrelated dependency could flip that binding and rewrite the peer suffixes of other projects in the lockfile #18162.Fixed duplicate packages with
nodeLinker: hoistedandautoInstallPeers: falsewhen identical transitive peer bindings appeared under parents with conflicting dependencies.When multiple
overridesselectors match a dependency, pnpm now picks the selector with the narrower version range regardless of the order in which the overrides are declared #18071.Patches that add lines to the end of a file without a final newline now install the whole file. pnpm dropped the last added line when the patch also marked it with
\ No newline at end of file#18156.Project
engines.nodechecks now use the Node.js runtime that pnpm links for the dependency groups being installed. If the lockfile records that runtime, the check uses its resolved version. Production installs ignore a runtime declared only indevEngines.runtimepnpm/tasks#302.pnpm installandpnpm approvenow discover, link, and prune agent skills fromworkspace:*,link:, and local directoryfile:direct dependencies.Cargo and Python
pnpm add crate:and targetedpnpm update crate:commands keep compatible versions fromCargo.lockfor other crates pnpm/tasks#257.pnpm add crate:<pkg>no longer corrupts multiline arrays inCargo.toml. Saving an explicit version withpnpm add crate:<pkg>@<version>now replacesworkspace = trueon existing dependency entries. Inherited workspace settings such asfeatures,default-features, andpackagestay on the updated entry.pnpm installnow accepts unversioned path dependencies on prerelease Cargo workspace members. Cargo workspace inheritance now resolvespackagerenames.pnpm addforpypi:dependencies now preserves existing entries inpyproject.tomlwhose PEP 508 environment markers differ from the added requirement.pnpm addalso accepts PEP 508 direct URL requirements such aspypi:pkg @ https://....pnpm updateat a shared-environment workspace root without a root[project]table now updates matching member manifests and the sharedpylock.toml.An invalid entry in a Python registry's
packageslist now names the patterns a Python registry accepts: an exact name, a prefix such ascompany-*, or**. The error used to suggest@scope/*, which a Python registry rejects. It also quotes the entry as written. A rejected prefix such as-a*used to appear as-ax.Running scripts
verifyDepsBeforeRunno longer reports the dependencies as out of date whenruntimeOnFailstops pnpm from installing the runtime thatdevEngines.runtimeorengines.runtimedeclares #18155.Commands that install a single project of a workspace, such as
pnpm add -w, now applyruntimeOnFailto the other workspace projects too. They no longer install a runtime thatruntimeOnFailexcludes.pnpm --if-present start,pnpm run --if-present start, andpnpm restart --if-presentnow exit with code 0 when a project has neither astartscript nor aserver.jsfile #18073.pnpm test,pnpm t, andpnpm tstin a single-package project now fail withERR_PNPM_NO_SCRIPTwhen thetestscript is missing unless--if-presentis passed #18073.shellEmulatornow handles escaped backslashes (\\) and unquoted escaped single quotes (\') according to POSIX quoting rules. Previously, scripts containing"a\\"or\'failed to parse or misquoted later${...}parameter expansions.pnpm createnow forwards--env-fileand other CLI flags placed after the starter template name to the starter command.pnpm pipelinenow hashes no input files wheninputs: []is configured.+-prefixed input globs include gitignored files and workspace files outside the project directory.!-prefixed input globs exclude matching files. Tasks that depend on an uncacheable task now bypass cached output restoration and re-run after that dependency executes. Read-only cached output files restore without permission errors. Task keys now hash each project's wanted lockfile across per-project lockfiles, customlockfileDir, and branch lockfiles.Build approvals
pnpm approve-buildsandpnpm approvewithout package arguments or--allnow fail withERR_PNPM_APPROVE_BUILDS_NON_INTERACTIVEandERR_PNPM_APPROVE_NON_INTERACTIVEwhen packages are awaiting approval in CI or without an interactive terminal.pnpm dlxand global installs also skip automatic build-approval prompts in CI, leaving pending builds unapproved.pnpm approve-buildsandpnpm add --allow-buildno longer corrupt apnpm-workspace.yamlwhose last line has no line break.Workspaces and lockfiles
Combining
--filterand--filter-prodwith exclusion selectors such as!pkgnow evaluates all selectors together in command-line order. An exclusion passed on one flag while inclusions were passed on the other no longer selects every workspace project.pnpm -r fetchnow fetches each selected project's lockfile whensharedWorkspaceLockfileisfalse. Use--filterto limit which projects are fetched #18152.pnpm peersin workspaces withsharedWorkspaceLockfile: falsenow checks each selected project'spnpm-lock.yaml.pnpm cinow validates thatpnpm-lock.yamlexists and matchespackage.jsonbefore removingnode_modules.pnpm cleanandpnpm cinow honor--filter,--filter-prod, and--workspace-root.pnpm cleanandpnpm cialso clean rootnode_modulesin workspaces without a rootpackage.json.pnpm clean --lockfilenow removes per-project lockfiles and lockfiles inside a customlockfileDir.pnpm clean,pnpm purge, andpnpm cikeep files outside the project untouched whenmodulesDirpoints outside the project root. Whennode_modulesis a symlink,pnpmnow unlinks the symlink without modifying its target #18072.pnpm importnow preserves locked versions fornpm:aliased dependencies when importing frompackage-lock.json,npm-shrinkwrap.json, oryarn.lock.pnpm importalso parses Yarn Classicyarn.lockfiles that reference__metadatapackage names without treating them as Yarn Berry lockfiles.Updating, publishing, and versioning
pnpm updatenow moves anengines.pnpmrange along with the pnpm version inpackageManagerordevEngines.packageManager#18142.Fixed GitHub Actions support in
pnpm updateandpnpm outdated. Updating a workflow step with a major or minor version comment such as# v4or a prose comment now formats the updated version comment cleanly. Negated action selectors such as!actions/cache/savenow exclude only the targeted subpath actions. Passing only negated action selectors still updates packages. Previously, negated action selectors skipped package updates.pnpm outdatednow reports every distinct outdated version when several workflows pin the same action at different versions.Fixed
pnpm updateskipping package updates when a Package URL selector such aspkg:npm/foois combined with--include-github-actions.pnpm update -g --latestnow upgrades global runtimes (node,deno, andbun) andnpm:-aliased global packages across major versions.pnpm update --changesetnow generates a changeset when a.changesetdirectory exists orversioningis configured inpnpm-workspace.yaml, without requiring.changeset/config.json. It also respectsversioning.ignorealongside.changeset/config.json.pnpm version -rnow runs each bumped package'spreversion,version, andpostversionscripts unless--ignore-scriptsor--dry-runis set.pnpm version -r --dry-run --jsonnow prints the planned releases as a JSON array.pnpm lane <lane> --filter <selector>now rejects partial moves of aversioning.fixedgroup withERR_PNPM_VERSIONING_CONFLICTING_CONFIGbefore writingpnpm-workspace.yaml.pnpm -C <dir> publish <tarball|folder>andpnpm --dir <dir> publish <tarball|folder>now resolve relative tarball and directory arguments against<dir>. Git checks duringpnpm publishalso inspect the target directory.pnpm -r publishnow skips workspace manifests whosenameorversionfield is an empty string.pnpm -r pack --outnow expands%sand%vplaceholders only in the--outtemplate. Literal%sand%vsegments in the working directory path stay unchanged.Other commands and settings
pnpm config set --global --json toolsnow writestoolsto the globalconfig.yamland validates its structure before saving.pnpm config set --globalalso acceptspm-on-failandruntime-on-fail.blockExoticSubdepsandexcludeLinksFromLockfileset in the globalconfig.yamlnow take effect during installs and appear inpnpm config get --global. pnpm now ignores workspace-only settings in the globalconfig.yamland prints a warning, matchingpnpm config set --global.${VAR}placeholders inpnpm-workspace.yamlwritten with YAML flow syntax now fail on registry URLs withERR_PNPM_REGISTRY_ENV_NOT_EXPANDED. Placeholders in flow-style proxy,pnprServer, anduserAgentsettings are now ignored with a warning #18074.updateConfigandafterAllResolvedhooks in.pnpmfile.cjsthat returnundefined,null, or a non-object value now fail withERR_PNPM_CONFIG_IS_UNDEFINEDandERR_PNPM_BAD_AFTER_ALL_RESOLVED_RETURN.findersin.pnpmfile.cjsthat return an empty string no longer match packages inpnpm list --find-byorpnpm why --find-by.pnpm listno longer adds annpm:prefix to aliased localfile:directory dependencies, andpnpm list --jsonpreserves<name>@file:<path>in theirversionfield.pnpm list --parseable --longnow keeps<name>@onlink:andfile:dependencies whose path or peer suffix contains@, such aslink:../@scope/pkg. Aliased scopedfile:dependencies whose path contains@also keep<name>@inpnpm list.pnpm whyno longer merges distinct localfile:directory dependencies that share the same package name across projects with dedicated lockfiles (sharedWorkspaceLockfile: false).pnpm sbomandpnpm licenses listnow resolvenamedRegistriesversion prefixes in lockfile entries.pnpm sbomemits bare component versions with a sanitizedrepository_urlPURL qualifier.pnpm sbomderives tarball download URLs from the named registry.pnpm licenses listreports packages from named registries as separate entries with bare versions andregistryName.pnpm pkgnow reads and writes the project manifest as written on disk.pnpm pkg getno longer reports syntheticruntime:dependency entries fromdevEngines.runtimeorengines.runtime.pnpm pkg setandpnpm pkg deletenow preservedevEngines.runtime,engines.runtime, and empty dependency objects set with--json.pnpm pmnow works after CLI flags such as--dirand afterpnpm with current.pnpm with currentalso accepts subcommand boolean flags such aspnpm --bare with current initahead ofwith.pnpm envcommands (use,list, andremove) now accept Node.js version specifiers with a leadingv, including prerelease versions such asv22.0.0-rc.1.pnpm doctornow checks write access for the cache, store, and global bin directories before they have been created. Previously,pnpm doctorreportedno write accesson fresh environments.pnpm doctornow probes whether reflinks or hardlinks work from the store into the project's link target and warns when neither does.Output and error messages
An error from a failed dependency resolution, such as an unreachable registry or a throwing pnpmfile resolver, now prints its cause once #18077.
pnpm no longer wraps error messages at the output width, so URLs and paths in them stay intact when stderr is not a terminal #18078.
pnpm installwithnodeLinker: hoistedno longer counts missing packages as removed. This fixes inflated removal counts for skipped optional dependencies #18178.pnpm outdated --jsonandpnpm outdated --format=jsonnow write reporter warnings tostderr. Warnings previously appeared onstdoutbefore the JSON output.pnpm stagewith--jsonnow keepsstdoutvalid JSON during dry runs, empty workspace runs, and errors.pnpm pipeline --dry-run --jsonandpnpm -r run --dry-run --jsonnow write reporter warnings and scope lines tostderr.pnpmwarns when anupdateConfighook changesregistriesand some routes still use their configured registry. The warning names those routes and points toregistriesByScope.pnpm cat-filenow reportsERR_PNPM_INVALID_HASHwhen given an empty, malformed, or truncated digest such assha512-.Platinum Sponsors
Gold Sponsors
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate CLI.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.