fix(arborist): ignore hidden entries in global update#9299
Merged
owlstronaut merged 1 commit intonpm:latestfrom May 4, 2026
Merged
fix(arborist): ignore hidden entries in global update#9299owlstronaut merged 1 commit intonpm:latestfrom
owlstronaut merged 1 commit intonpm:latestfrom
Conversation
owlstronaut
approved these changes
May 4, 2026
Contributor
|
🎉 Backport to |
owlstronaut
pushed a commit
that referenced
this pull request
May 4, 2026
## Description Fixes #9298. `buildIdealTree` handles global updates by reading the global `node_modules` folder directly and adding each entry as a synthetic top-level dependency. That path did not ignore hidden entries, so a directory like `.hidden-non-package` was converted to `.hidden-non-package@*` and rejected by `npm-package-arg`. This applies the same hidden-entry filter already used by `loadActual`, so hidden directories and retired scoped package folders are not treated as installed global packages during `npm up -g`. ## Testing ```sh node node_modules/tap/bin/run.js workspaces/arborist/test/arborist/build-ideal-tree.js -g "update global ignores hidden" ``` ```sh npm_config_prefix=/tmp/npm-hidden-global-patched.azXmRd node . up -g ``` ```sh node . run eslint -- workspaces/arborist/lib/arborist/build-ideal-tree.js workspaces/arborist/test/arborist/build-ideal-tree.js ``` (cherry picked from commit 32940e2)
This was referenced May 4, 2026
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.
Description
Fixes #9298.
buildIdealTreehandles global updates by reading the globalnode_modulesfolder directly and adding each entry as a synthetic top-level dependency. That path did not ignore hidden entries, so a directory like.hidden-non-packagewas converted to.hidden-non-package@*and rejected bynpm-package-arg.This applies the same hidden-entry filter already used by
loadActual, so hidden directories and retired scoped package folders are not treated as installed global packages duringnpm up -g.Testing
node node_modules/tap/bin/run.js workspaces/arborist/test/arborist/build-ideal-tree.js -g "update global ignores hidden"npm_config_prefix=/tmp/npm-hidden-global-patched.azXmRd node . up -gnode . run eslint -- workspaces/arborist/lib/arborist/build-ideal-tree.js workspaces/arborist/test/arborist/build-ideal-tree.js