Skip to content

fix(arborist): keep locked versions when extension rules change - #9989

Open
manzoorwanijk wants to merge 1 commit into
npm:latestfrom
manzoorwanijk:fix/package-extensions-keep-locked-versions
Open

manzoorwanijk wants to merge 1 commit into
npm:latestfrom
manzoorwanijk:fix/package-extensions-keep-locked-versions

Conversation

@manzoorwanijk

Copy link
Copy Markdown
Contributor

When the packageExtensions or .npm-extension hash changes, npm install upgraded every affected package to the newest version in range, even though only its manifest needed refreshing.
The affected nodes are detached and rebuilt from the edge spec, so pacote picked the newest match instead of the locked version.

#detachForExtensionRefresh now remembers the locked registry versions in each detached subtree, and #nodeFromSpec refetches the newest one that still satisfies the edge.
Linked, bundled and audit-vulnerable nodes are not reused, npm update <name> and explicit installs still upgrade, and a locked version that is no longer published (ETARGET) falls back to the edge spec.

References

Fixes #9981

@manzoorwanijk
manzoorwanijk marked this pull request as ready for review September 15, 2026 11:03
@manzoorwanijk
manzoorwanijk requested a review from a team as a code owner September 15, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Changing packageExtensions or .npm-extension upgrades locked packages to the newest version in range

1 participant