Minor Changes
-
node_modules/.modules.yamlno longer records the registries an install resolved from, and the recorded copy is dropped from the file on the first install that rewrites it.It dated from the lockfile format that spelled a dependency's path relative to its registry, where reading an installed tree meant knowing the registries it was installed with. Dependency paths have not carried a registry for several major versions, and the recorded copy outlived its use:
pnpm list,pnpm why, and single-project installs preferred it over the project's own configuration, so a project whose registry had changed since its last install was still read through the old one.They now use the configured registries, like every other command already did.
-
When
enableGlobalVirtualStoreis on, every process pnpm spawns for the project (pnpm run,pnpm exec, lifecycle scripts) now receives aNODE_PATHpointing at the project's hoistednode_modules, plus aNODE_OPTIONS--importflag that registers a resolve hook restoringNODE_PATHlookups for ESM imports. Dependencies that import undeclared ("phantom") packages keep resolving under the global virtual store — for both CommonJS and ESM — without installing the@pnpm/plugin-esm-node-pathconfig dependency pnpm/pnpm#9618. Tools run bypnpm dlxresolve such dependencies too: the JS CLI passes them the same environment, while the Rust CLI's dlx cache is self-contained, so its layout already exposes them. -
A registry can now declare that its abbreviated metadata carries the
timefield, soresolutionMode: time-basedreads the full metadata document only from the registries that need it:resolutionMode: time-based registries: https://npm.internal.example/: supportsTimeField: true
registry.npmjs.orgomitstimefrom abbreviated metadata, so a time-based resolution has to fall back to the much larger full document. That fallback used to be all-or-nothing:registrySupportsTimeFieldanswered for every registry at once, so a project resolving from both the public registry and a Verdaccio instance either paid for full metadata everywhere or claimed atimefield npmjs does not serve. The answer is now per registry, andregistrySupportsTimeFieldremains the answer for every registry that does not declare one.The declaration is also sent to a pnpr server, which applies it to the resolution it runs on the client's behalf.
-
A pnpr resolve request now carries the client's registries the way the
registriessetting declares them — keyed by URL, with the scopes routed to each, the bare-specifier prefix each answers to, and each one'sserverType— in place of the prefix map it used to send.The server routes them through the same inversion the config reader runs, so a pnpr-served install resolves a scoped dependency from the registry that scope is routed to, which it previously could not: only the default registry and the prefix-addressed ones reached the server. A declared
serverTypereaches it too, so the tarball URLs pnpr omits from the lockfile match the ones the client reconstructs.Built-in scope routes the project has not pointed elsewhere are not declared, so a pnpr server's allowlist is not asked about
npm.jsr.ioon requests that resolve no JSR package.A registry a request only declares is no longer refused up front for being off the server's allowlist — a client describes its whole configuration, including scopes a given resolve never reaches, so a stray
@scope:registryin a developer's~/.npmrcno longer fails every install against a pnpr server that does not serve it. The boundary moves to the fetch itself: an origin the resolve does reach is refused before the request leaves the server, with the same message.This changes the resolve and verify-lockfile request bodies. A pnpr server and its clients have to be on matching versions; the protocol is still experimental and unversioned.
-
A resolve request now carries the client's
resolutionMode, so an install delegated to a pnpr server picks versions the way the client would.time-basedandlowest-directreached the server as nothing at all, leaving it on itshighestdefault: the returned lockfile pinned the highest satisfying version of every dependency, and the setting appeared to be ignored.This adds a field to the resolve request body. A server older than its client ignores it and keeps resolving
highest; the protocol is still experimental and unversioned. -
The
registriessetting now declares a registry once, keyed by its URL, with everything about that registry in the entry: how it lays out tarball URLs, the scopes routed to it, and the bare-specifier prefix it answers to.registries: https://artifactory.example.com/artifactory/api/npm/npm-virtual/: serverType: artifactory scopes: ['@acme', '@acme-internal'] prefix: work
serverTypetells pnpm how the registry lays out its tarball URLs, which decides whether a URL can be omitted frompnpm-lock.yaml:- undeclared (the default) — strict. Only the exact canonical URL is treated as reconstructible.
npm— the registry behaves likeregistry.npmjs.org, which also serves a scoped package from its percent-encoded path. Declare this for a faithful mirror or caching proxy of the public registry so its tarball URLs can be omitted too.artifactory— JFrog Artifactory repeats the scope in a scoped package's tarball filename (@acme/widget/-/@acme/widget-1.0.0.tgz) where the npm registry strips it (@acme/widget/-/widget-1.0.0.tgz). Declaring it lets pnpm rebuild that URL, so it is omitted frompnpm-lock.yamlinstead of being written out for every scoped package pnpm/get-npm-tarball-url#16.
scopeslists the@-prefixed scopes that resolve from this registry. A bare'@'is the scope-less default registry, the one theregistrysetting names.prefixis the alias a dependency addresses this registry by, as in"foo": "work:^1.0.0".
The layout is never inferred from the registry URL, so nothing changes unless you declare it;
registry.npmjs.orgcontinues to behave asnpmwithout being declared. Because the lockfile depends onserverType, it is read frompnpm-workspace.yamlonly — aserverTypein the globalconfig.yamlis ignored, so one developer's machine cannot shape a lockfile their collaborators read back with a different layout. Credentials are rejected in this setting, in a key as well as in a field, and still belong in.npmrc. An entry that routes nothing to itself and matches no configured registry is reported as a warning rather than silently ignored.Migrating
The older
registriesshape, a map of<scope>: <url>strings, still works and needs no change:registries: '@acme': https://npm.acme.example/
namedRegistriesis deprecated in favor of theprefixfield, and is still read for prefixesregistriesdoes not declare.toLockfileResolutionandisCanonicalRegistryTarballUrlnow take their registry and layout as an options object rather than positional arguments, so@pnpm/lockfile.utilsand@pnpm/resolving.tarball-urlget a major bump. -
Added
virtualStoreType, which names where the virtual store lives — one store per machine, or one per project:virtualStoreType: global # or: project
It is the canonical spelling of
enableGlobalVirtualStore, which keeps working. When a project sets both,virtualStoreTypewins. It can also be set throughPNPM_CONFIG_VIRTUAL_STORE_TYPEand read back withpnpm config get virtualStoreType. The default is unchanged —project, so the shared store stays opt-in.The setting is independent of
nodeLinker.isolatedandpnpboth work with either store type, andhoistedwrites no virtual store at all, so it is unaffected.
Patch Changes
-
Fixed
pnpm patch-commitin project and edit paths containing non-ASCII characters. -
Fixed
404errors when installing from a registry that serves scoped packages only from a percent-encoded path, such as GitHub Enterprise Server. Outsideregistry.npmjs.org, a tarball URL that encodes the scope separator as%2for%2Fis no longer mistaken for one that pnpm can rebuild from the package name, version, and registry, so it is kept inpnpm-lock.yamland requested verbatim on the next install #13534. -
Fixed an inconsistency where
minimumReleaseAgeExclude(andtrustPolicyExclude) wildcard/bare-name rules behaved differently in the evaluator and normalizer. A bare rule now consistently evaluates as matching every version, preventing unexpected behavior and silent widening of version policy exemptions when pnpm rewrites the workspace manifest pnpm/pnpm#13725. -
Fixed
pnpm update --global --latestfailing with a 404 error when a globally installed package was not added from the registry by name. Packages installed from a local path (link:/file:), a git repository, a tarball URL, annpm:alias, or a named registry now keep their spec during a global update instead of being looked up by name in the default registry. See #12854. -
pnpm outdatedandpnpm update --interactivenow dereferencecatalog:specifiers before querying the registry. A catalog entry that is an npm alias ('@types/zkochan__table': npm:@types/table@6.3.2) no longer fails withERR_PNPM_OUTDATED_REGISTRY_ERRORfor the alias key, andpnpm outdated --compatiblecompares against the range the catalog holds instead of skipping the dependency. -
A failed packument request now reports the status the registry returned (
404 Not Found) instead of "error decoding response body". -
Installs with a cold cache are significantly faster: lockfile verification no longer delays resolution or downloads and re-checks far less data over the network, and downloaded packages are linked while the remaining downloads are still in flight.
-
Fixed
pnpminstalls using pnpr to honor the client'sautoInstallPeers,dedupePeers, andexcludeLinksFromLockfilesettings pnpm/pnpm#13389. -
The three registry lookups are now named for what they are keyed by, so that none of them is called
registries— a name theregistriessetting itself has taken:before after Config.registriesConfig.registriesByScopeConfig.namedRegistriesConfig.registriesByPrefixConfig.registryOptionsConfig.registryOptionsByUrlThe same rename applies to the
RegistryContextfields, theRegistriesandNamedRegistriestypes (nowRegistriesByScopeandRegistriesByPrefix),normalizeRegistries/normalizeNamedRegistries(nownormalizeRegistriesByScope/normalizeRegistriesByPrefix), and theBUILTIN_NAMED_REGISTRIESconstant (nowBUILTIN_REGISTRIES_BY_PREFIX).This is an internal rename: no setting, error code, lockfile field, or
.pnpmfile.cjshook field changes. ApreResolutionhook still readsctx.registries, which is the name pacquet passes as well. TheregistriesandnamedRegistriessettings are read under the names users write them.The pnpr resolve request sends
registriesByPrefixwhere it sentnamedRegistries. A pnpr server and its clients must be on matching versions, which is already the case for an experimental server. -
An install that had to re-hash store files to verify them now reports it. If that cost more than a second, it says how long —
The integrity of N files was checked in 2.5s.— and if it was quick but covered more than a thousand files, it names the cause instead: their timestamps changed since the store recorded them, which a backup tool, an antivirus scan or a copied store can do. -
Installs are faster in workspaces that declare inter-workspace dependencies with plain ranges (
"*","^1.2.3") rather than theworkspace:protocol. WithpreferWorkspacePackagesenabled, linking such a dependency no longer makes a registry request that cannot change the outcome — and workspace packages that were never published no longer cost a 404 on every install. -
An override change is now absorbed by the fast lockfile update even when another, unchanged override uses the
catalog:protocol. Previously anycatalog:-valued override forced a full re-resolution whenever the override list changed, which could move unrelated packages in the lockfile (for example afterpnpm audit --fixadded an override). -
Reduced peak memory usage when installing large packages. A tarball whose compressed size is at least 16 MiB, or whose registry-reported unpacked size is at least 64 MiB, is now extracted by streaming the decompression directly into the content-addressable store instead of materializing the whole decompressed archive in memory, and its large files are hashed and written to the store incrementally.
-
pnpm whyandpnpm listno longer print stray[90m-style codes in their trees when the terminal supports colors. The bolded labels — the searched package inpnpm why, the project header and the matched package inpnpm list— dropped the escape byte of the styles they already carried, leaving the color codes as visible text.