Skip to content

fix(arborist): ignore hidden entries in global update#9303

Merged
owlstronaut merged 1 commit intorelease/v11from
backport/v11/9299
May 4, 2026
Merged

fix(arborist): ignore hidden entries in global update#9303
owlstronaut merged 1 commit intorelease/v11from
backport/v11/9299

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 4, 2026

Backport of #9299 to release/v11.

## 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)
@owlstronaut owlstronaut merged commit 3298369 into release/v11 May 4, 2026
17 checks passed
@owlstronaut owlstronaut deleted the backport/v11/9299 branch May 4, 2026 19:29
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.

2 participants