Repository navigation
fix(arborist): derive linked bin cleanup paths through bin-links (v10 backport) - #10346
Open
jasperjjhe wants to merge 1 commit into
Open
jasperjjhe wants to merge 1 commit into
jasperjjhe wants to merge 1 commit into
Conversation
Backport of npm#10057 to release/v10.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Manual backport of #10057 to
release/v10, as requested by the backport automation note on that PR (the cherry-pick to release/v10 conflicted; the v11 backport landed as #10266).npm 10 bundles bin-links@5.0.1, which includes the bin metadata normalization from bin-links#193 (the v5 maintenance-line release of npm/bin-links#187).
Node.binPathsalready routes throughbin-links#getPaths, so hoisted installs produce normalized bin paths. The linked install strategy's cleanup derivation inisolated-reifierstill manually joins lockfile-provided bin keys, so traversal-bearing, absolute, or Windows-style bin keys in a lockfile can produce cleanup paths outside the package's node_modules/.bin when an optional dependency recorded in the lockfile fails to extract and reify cleans it up with scripts disabled. This routes that derivation throughbin-links#getPaths()using the dependency's consumer-facing installation path, the same fix shape as #10057, so both strategies share the bundled normalization.This is the Arborist integration for CLI-CROW-GEN-002 on the v10 line. It does not introduce an Arborist-owned normalizer or modify the bundled dependency.
Changes
bin-links#getPaths()using the dependency's consumer-facing installation path, not its store path.Node.binPathsregression coverage for traversal-bearing, absolute, Windows-style and invalid bin metadata, including preservation of the caller's metadata (adapted verbatim from fix(arborist): derive linked bin cleanup paths through bin-links #10057; v10's Node already uses getPaths and the bundled bin-links@5.0.1 provides the normalization).@isaacs/testing-missing-tgztarball,@isaacs/this-does-not-exist-at-allpackument) instead of the v12 registry-mock helper, and the lockfile resolved URLs point at the local mock registry).Dependency status
No dependency changes. bin-links@5.0.1 (released 2026-10-26 via bin-links#193 with the getPaths normalization) is already pinned in the v10 lockfile, and no other v12-only change is required by the fix.
Notes
backport:v10label if that helps your automation.Validation
release/v10at 3475294 (git apply --checkverified against a pristine checkout).npm ci):tap test/arborist/reify.js test/node.jspasses 107/107 and 56/56 including the adapted tests, andeslinton the three touched files is clean. Unpatched control at the same SHA also passes, so the adapted tests are the only delta.tnockfixture toggles nock's global net-connect state per test; the adapted tests deliberately avoid it and use the fixture server's built-in 404 paths instead, so the suite state machine is untouched.