PNpM CLI
pnpm 11.29.0 stops reading otp from config files, rejects local filesystem dependencies declared by registry packages, adds the --minimum-release-age option, and recreates an incompatible node_modules without a TTY. This release carries several security fixes.
Minor Changes
-
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_SETTINGinstead of writing an entry no loader reads back.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.
Patch Changes
Security
-
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. -
Tarball downloads send registry credentials only over HTTPS or loopback HTTP. 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.
-
Tarball URL preflight requests use the configured credentials and fetch retry settings.
-
TLS file paths in
.npmrcandauth.iniresolve relative to the file that declares them. Project.npmrcfiles skip TLS file paths containing environment variables.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. Setting a project-leveltokenHelperfails. -
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 dlx,pnx, andpnpm createnow handle local isolation, script skipping, and non-registry package specifiers consistently:pnpmignores local.pnpmfile.cjshooks and project.npmrcproxy or TLS settings in the working directory.- Running with
--ignore-scriptsorignoreScripts: trueuses a separatedlxcache key, keeping cached installs that skipped build scripts separate from normal runs. - Relative local directory and tarball specifiers such as
./my-cliand./my-cli.tgzresolve against the caller's working directory. - Explicitly requested tarball URL,
file:, and git URL packages run their build scripts by default unless--ignore-scriptsor a negated--allow-buildselector disables them.
-
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 packandpnpm publishnow rejectpublishConfig.directoryvalues that use an absolute path or..segments outside the package directory. -
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 installwithpnprServerconfigured now falls back to local resolution when the project declaresfile:,link:, or local path dependencies.pnpralso rejects local filesystem dependency specifiers on/-/pnpr/v0/resolve. -
Installs through a pnpr server now enforce
minimumReleaseAgeStrictand add fallback versions tominimumReleaseAgeExcludewhen strict mode is off. -
pnpm installnow records the supply-chain verification of the lockfile it writes by the lockfile's content. Before, a lockfile that another process put in its place right after the write could reuse that verification on the next install. -
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.
Installing packages
-
pnpm installno longer fails without a TTY when it has to recreate an incompatiblenode_modulesdirectory, such as in a Docker build or with piped stdin #6778, #9166, #8654, #8085. It now recreates the directory and prints a warning that explains why. A custom or symlinked modules directory still requires settingconfirmModulesPurgetofalse. -
pnpm installnow installs a workspace project located in a parent directory of the workspace root, such as one matched bypackages: ['..']#10096. -
Fixed
ERR_PNPM_LINKING_FAILEDon filesystems without copy-on-write reflinks when an install reuses an existing global virtual store entry before staging a package build. Also fixed mergingnode_modulesdirectories during staged package imports on filesystems such as Btrfs that reportEEXISTwhen renaming onto a non-empty directory. -
A filtered
pnpm installthat changes the installed dependency groups, such aspnpm --filter app install --prod, no longer empties thenode_modulesdirectories of the workspace projects it skips. -
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. -
Fixed
nodeLinker: hoistedinstalls omitting a dependency that its parent also declares as a peer dependency whenautoInstallPeersis disabled #18193. -
Fixed
nodeLinker: hoistedinstalls placing a package where one of its dependencies resolves to another version than the lockfile records. It could happen in a workspace whose projects depend on different versions of the same packages. In a workspace where one project's directory is inside another's, pnpm now keeps the inner project's dependency in its ownnode_moduleswhen the outer project holds another version. -
Fixed
pnpm pruneleaving extraneous package links in hoisted installations. -
Fixed Plug'n'Play installs with local
file:directory dependencies. Root projects can resolve their dependencies, and workspace projects with duplicate names retain their own dependencies. -
Plug'n'Play now combines custom export conditions from
NODE_OPTIONSand command-line flags. It also respects Node.js's enablednode-addonsandmodule-syncconditions. -
Fixed package maps resolving workspace and linked packages to the wrong directory when a path contains
#,?, or%. -
pnpm fetchnow applies patches to packages that are only reachable through localfile:dependencies #11034. -
Fixed
pnpm install --lockfile-onlyfetching unchanged Git dependencies when an unrelated dependency changes andtrustLockfileis enabled #18217. -
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. -
When an install is delegated to the Rust engine, pnpm now renders the lockfile verification progress that the engine reports. The pass and failure lines show how many entries were checked.
Lockfile and frozen installs
-
pnpm install --frozen-lockfilenow accepts a plain-range dependency of a local directory dependency thatlinkWorkspacePackages: deeplinked to a workspace project. It fails when theinjectedsetting of a dependency of a local directory dependency no longer matches the lockfile pnpm/tasks#319. -
Frozen installs now detect changes to catalog entries used only by peer dependencies of local directory packages.
-
pnpm install --frozen-lockfilenow revalidates registry metadata when verifying a locked tarball whose version is missing from the cached package listing. -
pnpm cino longer reports an existing current lockfile to thepreResolutionhook whenvirtualStoreDirpoints outside the project and the lockfile is about to be removed withnode_modules. -
pnpm can read lockfiles with large YAML merge mappings or ordered maps without the excessive parsing time seen in some cases #18246.
-
pnpm-lock.yamlnow quotes strings that look like numbers, such as+.5, so they are read back as strings.
Workspaces and scripts
-
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. -
pnpm installnow runs the workspace root'spnpm:devPreinstallscript whensharedWorkspaceLockfileisfalse#4503.pnpm install --dry-runno longer runs it. -
pnpm runandpnpm execnow find the Plug'n'Play loader and experimental package map whenlockfileDiris configured. This also applies to recursive commands. -
pnpm runandpnpm execno longer trigger a reinstall solely because the last install used--trust-lockfile#18218. -
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. -
pnpm skips unsupported command names in
directories.bin, including filenames with spaces. -
--resume-fromstarts at the named project when the previous run completed no tasks. -
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>']. -
pnpm --version,pnpm --help, andpnpm helpnow succeed when the project pins another package manager.
Patched dependencies
-
Fixed several bugs in applying patches:
- Deleting a file whose path contains
b/no longer deletes a different file. - A hunk without context lines now inserts its lines after the line its header names.
- A patch that creates a file no longer overwrites an existing file with different content. pnpm reports the patch as failed.
- Deleting a file whose path contains
-
pnpm patch-commitnow keeps a file without a final newline unterminated when that file comes last in the patch. Before, the patch dropped the final\ No newline at end of filemarker, so the patched file gained a trailing newline. -
pnpm patch-removenow removes the corresponding edit directory and state entry fromnode_modules/.pnpm_patches.
Packing, publishing, and deploying
-
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. -
Packed workspace dependencies now use the dependency's
publishConfig.name. -
Fixed
pnpm deployfor projects that depend on an external directory throughlink:. -
pnpm deploynow installs a workspace package from its publish directory only when the package'spackage.jsonsetspublishConfig.directoryto that directory. A publish directory that only the lockfile records is ignored. -
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. -
pnpm version -rupdates explicit workspace dependency ranges that a release invalidates.pnpm versionpreserves edits that apreversionscript makes to other manifest fields. -
When
pnpm unpublishremoves the version taggedlatest, it prefers the highest remaining stable version.
Configuration
-
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. -
minimumReleaseAgemust now be a finite, non-negative number of minutes. Other values fail withERR_PNPM_INVALID_MINIMUM_RELEASE_AGE. Before, such a value turned off the release age check or crashed the install. -
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. -
A setting in
pnpm-workspace.yamlor the globalconfig.yamlthat references an undefined environment variable without a fallback now fails withERR_PNPM_CONFIG_UNRESOLVED_ENV_VAR. Before, pnpm failed with an error that had no code #10963. -
Empty or whitespace-only numeric
pnpm_config_*environment variables no longer override configured values or defaults. -
pnpm now validates
noProxy,strictSsl,localAddress, andsideEffectsCache.excludein workspace and global configuration.noProxyaccepts strings and booleans, andnullleaves it unset. -
pnpm now reports
referenceTimeinpnpm-workspace.yamlas a setting of a newer pnpm version. -
Windows command shims preserve existing PATH entries when the
prependToPathoption is used.
Other commands and help
-
pnpm store prunenow fails withERR_PNPM_FROZEN_STORE_WRITEwhenfrozenStoreis enabled. Before, it removed files from the store. -
pnpm peers checknow resolves thecatalog:peer ranges of injected workspace packages through the workspace catalogs. WithautoInstallPeers: false, such a peer was reported as unmet even when the installed version matched the catalog entry #10279. -
Fixed
pnpm updateandpnpm outdatedwith--include-github-actionscorrupting workflow YAML or skipping actions referenced through YAML anchors, aliases, or merge keys. Combining a GitHub Action selector with a negated package selector such as!lodashno longer matches every package dependency. -
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. -
pnpm list -gwith--depthgreater than0now always reads the global install directory'snode_modulesand lockfile. Before, it could read the current project's lockfile or a custommodulesDir. -
pnpm list --jsonnow reports unsaved dependencies from each workspace project's own modules directory #18248. -
pnpm list --lockfile-only --find-bynow reads manifests from the configured store whennode_modulesis absent. -
pnpm why --exclude-peersnow leaves out packages that are reached only as a resolved peer dependency. Before, the flag was accepted but ignored. -
pnpm cat-filecan read executable files from the store.pnpm cache list,view, anddeleterecognize mixed-case package names.pnpm cleanremoves custom virtual stores with hidden directory names. In Plug'n'Play projects it also removes the generated loader on a full clean. -
Fixed
pnpm unlinkin CI and in workspace subprojects. It now removes matching linked dependencies from the selected manifests. -
Fixed
pnpm linkresolving a quoted~/path from the current directory. -
pnpm importrespects the symlink policy for the destination lockfile and skips Yarn patches outside the workspace. -
pnpm addrun from a workspace package directory that has nopackage.jsonyet now suggests creating one withpnpm init#11345. -
Removed the obsolete
xmascommand. -
pnpm helpandpnpm <command> --helpnow print the help when the system runtime does not satisfy the project'sdevEngines.runtimeorengines.runtime. -
pnpm clean --helpand the help of other commands a script can override now print the help, even whenpackage.jsonhas a script with the same name. -
An unknown option passed via a shorthand is now reported as typed, and the shorthand of the other case is suggested when the command supports it. For instance,
pnpm update -lused to fail withUnknown option: 'long', as-lis short for--long. Now it fails withUnknown option: '-l'and suggests-L(--latest). -
pnpm help importnow lists the output options, such as--reporter, that the command accepts #7829. -
The help for
pnpm config getandpnpm getnow says that the key is a property path, such ascatalog.react. -
Tab completion suggests project scripts when you type
pnpmfollowed by a script name #18239.
<!-- sponsors -->
Platinum Sponsors
<table> <tbody> <tr> <td align="center" valign="middle"> <a href="https://bit.cloud/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"><img src="https://pnpm.io/img/users/bit.svg" width="80" alt="Bit"></a> </td> <td align="center" valign="middle"> <a href="https://openai.com/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/openai_dark.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/openai_light.svg" /> <img src="https://pnpm.io/img/users/openai_dark.svg" width="160" alt="OpenAI" /> </picture> </a> </td> <td align="center" valign="middle"> <a href="https://notion.com/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/notion.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/notion_light.svg" /> <img src="https://pnpm.io/img/users/notion.svg" width="80" alt="Notion" /> </picture> </a> </td> </tr> <tr> <td align="center" valign="middle"> <a href="https://coderabbit.ai/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/coderabbit.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/coderabbit_light.svg" /> <img src="https://pnpm.io/img/users/coderabbit.svg" width="220" alt="CodeRabbit" /> </picture> </a> </td> <td align="center" valign="middle"> <a href="https://www.cloudflare.com/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/cloudflare.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/cloudflare_light.svg" /> <img src="https://pnpm.io/img/users/cloudflare.svg" width="160" alt="Cloudflare" /> </picture> </a> </td> </tr> </tbody> </table>
Gold Sponsors
<table> <tbody> <tr> <td align="center" valign="middle"> <a href="https://sanity.io/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/sanity.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/sanity_light.svg" /> <img src="https://pnpm.io/img/users/sanity.svg" width="120" alt="Sanity" /> </picture> </a> </td> <td align="center" valign="middle"> <a href="https://discord.com/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/discord.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/discord_light.svg" /> <img src="https://pnpm.io/img/users/discord.svg" width="220" alt="Discord" /> </picture> </a> </td> <td align="center" valign="middle"> <a href="https://vite.dev/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"><img src="https://pnpm.io/img/users/vitejs.svg" width="42" alt="Vite"></a> </td> </tr> <tr> <td align="center" valign="middle"> <a href="https://serpapi.com/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/serpapi_dark.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/serpapi_light.svg" /> <img src="https://pnpm.io/img/users/serpapi_dark.svg" width="160" alt="SerpApi" /> </picture> </a> </td> <td align="center" valign="middle"> <a href="https://stackblitz.com/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/stackblitz.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/stackblitz_light.svg" /> <img src="https://pnpm.io/img/users/stackblitz.svg" width="190" alt="Stackblitz" /> </picture> </a> </td> <td align="center" valign="middle"> <a href="https://workleap.com/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/workleap.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/workleap_light.svg" /> <img src="https://pnpm.io/img/users/workleap.svg" width="190" alt="Workleap" /> </picture> </a> </td> </tr> <tr> <td align="center" valign="middle"> <a href="https://nx.dev/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/nx.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/nx_light.svg" /> <img src="https://pnpm.io/img/users/nx.svg" width="50" alt="Nx" /> </picture> </a> </td> <td align="center" valign="middle"> <a href="https://latitude.so/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/latitude.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/latitude_light.svg" /> <img src="https://pnpm.io/img/users/latitude.svg" width="160" alt="Latitude" /> </picture> </a> </td> <td align="center" valign="middle"> <a href="https://syntax.fm/?utm_source=pnpm&utm_medium=release_notes" target="_blank" rel="noopener noreferrer"> <picture> <source media="(prefers-color-scheme: light)" srcset="https://pnpm.io/img/users/syntaxfm.svg" /> <source media="(prefers-color-scheme: dark)" srcset="https://pnpm.io/img/users/syntaxfm_light.svg" /> <img src="https://pnpm.io/img/users/syntaxfm.svg" width="90" alt="Syntax" /> </picture> </a> </td> </tr> </tbody> </table>
<!-- sponsors end -->