pnpm 12.17.0 adds pnpm peers check --global, dependency-group selectors and wildcards in overrides, and runtime, package manager, Cargo, and Python updates in pnpm outdated and pnpm update. It also fixes files that other users could not read in Docker images, and repeat installs that missed changes to local dependencies.
Minor Changes
-
pnpm peers checknow accepts--global(-g) to check globally installed packages. After a global install or update, the peer dependency warning now suggestspnpm peers check -g#17504. -
pnpm outdatedandpnpm updatenow inspect and update package manager and runtime versions indevEngines.packageManager,packageManager,devEngines.runtime,engines.runtime, andruntime:dependencies. Withcargo.enabledorpython.enabled,pnpm outdatedandpnpm updatealso inspect and update Cargo dependencies inCargo.tomlandCargo.lockand Python dependencies inpyproject.tomlandpylock.toml. -
overridesselectors now support:prod,:optional, and:peerpseudo-selectors that target a single dependency group. They also support*wildcard patterns on parent and target package names. An override with a non-range value, such asnpm:orfile:, no longer adds a peer dependency todependencies. Removing an optional dependency with"-"now also removes the duplicate entry fromdependencies#5391.
Patch Changes
Installing packages
-
Files that pnpm creates in a project now get the permissions the umask gives any new file, such as
0644. Before, several of them were readable only by the user who ran pnpm, which broke Docker images that run as a different user #17435.The fix applies to:
node_modules/.pnpm-workspace-state-v1.json. A different user runningpnpm runreinstalled the dependencies because it could not read this file.pnpm-workspace.yaml- the files written by
pnpm deploy - patch files from
pnpm patch-commit - the lockfile restored by
pnpm dedupe --check - the Cargo and Python files that pnpm writes
When pnpm edits an existing file, the file keeps its permissions.
-
pnpm installno longer writes broken dependency links when the project'snode_modulesis a symlink to another directory, such as another project'snode_modules. The install reported success, but the links it wrote did not resolve #17448. -
Commands installed with
pnpm add --globalnow find the dependencies that pnpm hoists for their package. A package that loads a dependency it does not declare, such as a native addon's platform-specific package, failed with "Cannot find module". Reinstall such a package withpnpm add --globalto update its existing command #17503. -
When pnpm switches to the version a project pins, it now installs that version's native binary for the current host, even if the project's
supportedArchitecturesexcludes the host. Before, pnpm could not use the pinned version and kept running the installed one. pnpm also repairs a pinned version that an earlier install left without the host's binary. -
With the global virtual store, a change to a dependency of one package in a dependency cycle now gives every package in that cycle a new directory. Before, the other packages kept their directories and still linked the old copy of the changed package, so the project could load two copies of it #17466.
Packages in a dependency cycle, and packages that depend on one, move to new global virtual store directories once after this update. Those that run a build miss the side-effects cache once.
-
With
nodeLinker: hoisted, when two workspace projects need the same package version and it cannot be hoisted to the root, each project now keeps the copy installed in its ownnode_modules. Build scripts run in each of these copies. Before, the second project's copy was replaced with a symlink to the first project's, so every repeat install imported it again #17498. -
The Node.js
latestselector now chooses the newest stable release #17490. -
Hardlinking from the store now stats each store file once per install. Since pnpm 12.8.0, a store file was stat'ed again for every package that links it. On an offline install of a large workspace, that added up to 15% system CPU #17500.
Repeat installs and local dependencies
-
pnpm install --frozen-lockfileno longer reports an outdated lockfile right after the install that wrote it. This happened when a pnpmfilereadPackagehook orpackageExtensionschanged the dependencies or peer dependencies of a local directory dependency outside the workspace projects. It affected afile:dependency, an injectedworkspace:../dirdependency outside the workspace patterns, and an injected workspace package left out by--filter#17447 #17473.A repeat
pnpm installnow takes the fast path whenignoredOptionalDependenciesremoves an optional dependency of afile:directory dependency. It used to resolve again on every run. -
pnpm installnow resolves again after an edit to an injectedworkspace:../dirdependency outside the workspace patterns under a shared lockfile. It used to keep the lockfile unchanged. The nextpnpm install --frozen-lockfilethen failed #17476. -
pnpm installnow resolves a local directory again after itspackage.jsonchanges when an override or a package extension adds it to the dependencies of a registry package.pnpm install --frozen-lockfilefails on a lockfile that still records the old dependencies of such a directory #17486. -
With
injectWorkspacePackagesand per-project lockfiles,pnpm installnow updates a project's lockfile when a local tarball that an injected workspace project depends on is replaced. The project's lockfile kept the old version and integrity before. -
pnpm installnow detects a change to a local tarball or directory that only a pnpmfilereadPackagehook depends on. A repeat install reported "Already up to date" and kept the old contents before pnpm/tasks#227. -
pnpm installnow relinks aworkspace:orlink:dependency whose link was deleted fromnode_modules. It used to report "Already up to date" and leave the link missing #17485. -
A repeat
pnpm installreports "Already up to date" again when a pnpmfilereadPackagehook changes the dependencies of a workspace project. Since 12.15.0, every such install ran in full #17468.After an edit to a project's
package.json,pnpm installandverifyDepsBeforeRunnow run the pnpmfile'sreadPackagehook on the edited manifest before comparing it with the lockfile. They could report the project up to date when the hook rewrote the edited dependency to a specifier the lockfile did not record.
Adding and updating dependencies
-
pnpm update --latestwith package selectors now updates the dependencies of the selected packages within their declared ranges. Excluded packages and their dependencies keep their locked versions #17444. -
pnpm add <pkg>@<tag>now uses a catalog entry set to that same dist-tag. The dependency is saved ascatalog:and the entry stays as written pnpm/tasks#225.When
pnpm addadds a new dist-tag such asvue@legacyto a catalog, the catalog entry records the exact version the tag points to. The same applies to a dependency added without a version when thetagsetting names a dist-tag other thanlatest. -
pnpm addnow saves the resolved version range of an npm alias. For example,pnpm add v2@npm:vueandpnpm add v2@npm:vue@^3.0.0both savenpm:vue@^3.5.13.
Running scripts and commands
-
Programs that a script or
pnpm execcommand leaves running, such as a browser opened by theopenpackage, now outlive pnpm exactly when they would outlive the command run without pnpm. Before, on Windows, a failed command,Ctrl+C, or a closed terminal ended all of them. pnpm still ends them when it is killed or crashes.When a recursive or parallel run bails, the scripts still running now receive
SIGTERMon Unix and are killed only if they are still running two seconds later. On Windows, everything those scripts started is ended, including detached processes whose parent has already exited. Before, a bail killed them at once #17465. -
On Windows, the shell shim of a
.cmdor.batbin now runs it under Git Bash when MSYS argument conversion is off, such as withMSYS_NO_PATHCONV=1orMSYS2_ARG_CONV_EXCL='*'. The shim used to start an interactive cmd.exe prompt #17480. -
pnxandpnpm createnow run the command in the directory selected by--diror--workspace-root. Without either flag, the command still runs in the directory pnpm was started in. -
pnpm --env-filenow reads files the waynode --env-filedoes. Values are taken as written, so$VARis no longer expanded and Windows paths such asC:\Users\meload unchanged. A file is no longer rejected for its contents.
Settings and messages
-
pnpm versionno longer creates a git commit and tag whengitTagVersionis set tofalse#17460. -
pnpm publishnow reads thepublishBranchsetting frompnpm-workspace.yamland fromPNPM_CONFIG_PUBLISH_BRANCH. The--publish-branchflag overrides it. -
pnpmnow accepts--strict-ssland--local-address <ip>on the command line. -
pnpm doctoruses a 15-second timeout when checking registry connectivity. -
pnpm-workspace.yamlparse errors now reportERR_PNPM_INVALID_SETTING. -
The error for a dependency with an invalid name in a project's manifest now names the project's directory. It used to say only "The current package", which did not tell which workspace project to fix #17475.
Platinum Sponsors
|
|
|
|
|
|
|
Gold Sponsors
|
|
|
|
|
|
|
|
|
|
|
|