GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: pass _isRoot context where missing by wraithgar · Pull Request #9206 · npm/cli

Conversation

@wraithgar

@wraithgar wraithgar commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

fixes: #9189

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Cherry reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@wraithgar
wraithgar requested a review from a team as a code owner April 8, 2026 17:32
@wraithgar
fix: pass _isRoot context where missing
23d9832
fixes: #9189
@wraithgar
wraithgar force-pushed the gar/allow-git-fix branch from 6bab875 to 23d9832 Compare April 8, 2026 17:34
owlstronaut
owlstronaut approved these changes Apr 8, 2026
View reviewed changes

@owlstronaut owlstronaut left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@akhenry

akhenry commented Apr 8, 2026

Copy link
Copy Markdown

Seems like maybe there's a sketchy test here as well - https://github.com/npm/cli/pull/8943/changes#diff-8ab375e634149f489e0f560b62170ee8770114b25f0d314c83e0493c5b2bf02bR259

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wraithgar

wraithgar commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

The test was fine, it's a negative test (i.e. refuses a situation). There is no positive test (i.e. allows the situation) and that's what would have caught this.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@akhenry

akhenry commented Apr 8, 2026

Copy link
Copy Markdown

The test was fine, it's a negative test (i.e. refuses a situation). There is no positive test (i.e. allows the situation) and that's what would have caught this.

Even if it's a negative test, it doesn't actually set allow-git to root, so it doesn't seem to be testing what it says it's testing:

Screenshot 2026-04-08 at 1 58 29 PM
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@akhenry

akhenry commented Apr 8, 2026

Copy link
Copy Markdown

In any case, thank you for addressing this issue so quickly! Appreciate it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@owlstronaut owlstronaut closed this Apr 15, 2026
@owlstronaut owlstronaut reopened this Apr 15, 2026
@wraithgar wraithgar added the backport:v11 label Apr 15, 2026
@wraithgar
wraithgar merged commit dcad8ec into latest Apr 15, 2026
32 of 35 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@wraithgar
wraithgar deleted the gar/allow-git-fix branch April 15, 2026 17:54
github-actions Bot pushed a commit that referenced this pull request Apr 15, 2026
@wraithgar @npm-cli-bot
fix: pass _isRoot context where missing (#9206)
3b4358c
fixes: #9189
(cherry picked from commit dcad8ec)
@github-actions github-actions Bot mentioned this pull request Apr 15, 2026
fix: pass _isRoot context where missing #9237
Merged
@github-actions

This comment was marked as outdated.

Sign in to view
@github-actions github-actions Bot mentioned this pull request Apr 15, 2026
chore: release 12.0.0-pre.0.0 #9229
Merged
wraithgar pushed a commit that referenced this pull request Apr 15, 2026
@github-actions
fix: pass _isRoot context where missing (#9237)
cff9ce9
Backport of #9206 to `release/v11`
reggi pushed a commit that referenced this pull request Apr 21, 2026
@wraithgar @reggi
fix: pass _isRoot context where missing (#9206)
6f3b0f5
fixes: #9189
@mschile mschile mentioned this pull request May 21, 2026
fix(cli): extract the Cypress binary with yauzl instead of extract-zip cypress-io/cypress#33887
Merged
1 task done
@github-actions github-actions Bot mentioned this pull request May 27, 2026
chore: release 12.0.0-pre.1 #9387
Merged
@j178 j178 mentioned this pull request Jul 24, 2026
Install Node hooks through git url j178/prek#2394
Merged
wayneminwang added a commit to wayneminwang/action-pre-commit that referenced this pull request Sep 21, 2026
@wayneminwang
fix: pin npm past the EALLOWGIT regression instead of pinning pre-commit
6b8ef1c
npm 11.9.0-11.12.x has a real upstream bug (npm/cli#9189, fixed in 11.13.0
via npm/cli#9206/#9237): --allow-git=root incorrectly rejects legitimate
root-level git installs. pre-commit's `language: node` installer
(rewritten in 4.6.1) hits exactly this path for any hook with
additional_dependencies, e.g. mirrors-prettier/mirrors-eslint, failing
with:

  npm error code EALLOWGIT
  npm error Fetching non-root packages of type "git" have been disabled

This replaces the earlier approach (pinning pre-commit below 4.6.1) with
a fix at the actual root cause -- npm, not pre-commit -- verified against
a real npm issue/fix rather than a hypothesis about pre-commit's installer.
pre-commit itself no longer needs any special handling.

Also ensures pre-commit treats our node/npm as a usable "system" install
(pre_commit/lang_base.py::exe_exists rejects executables resolved from
inside $HOME, which is where our self-hosted runners install node) --
without this, pre-commit ignores the npm we just pinned and downloads its
own via nodeenv instead.

The npm version is pinned to an exact, verified value rather than an open
range or "latest": bumping it is a deliberate action that should be
re-verified first, not something that silently drifts the way this bug
shipped in the first place.
This was referenced Sep 21, 2026
fix: pin npm past an EALLOWGIT regression that breaks node-hook installs open-turo/action-pre-commit#208
Closed
fix: pin npm past an EALLOWGIT regression that breaks node-hook installs open-turo/action-pre-commit#210
Merged
@felixonmars felixonmars mentioned this pull request Oct 7, 2026
addpatch: pre-commit 4.6.2-1 felixonmars/archriscv-packages#6137
Merged
felixonmars added a commit to felixonmars/archriscv-packages that referenced this pull request Oct 7, 2026
@felixonmars
addpatch: pre-commit 4.6.2-1
f3502ed
Fix the Node and Rust bootstrap paths rather than excluding the three failing integration tests.

npm 11.9 through 11.12 mishandles --allow-git=root, including npm 11.12.1 bundled with the newest unofficial riscv64 Node binary. Upgrade only those broken versions to npm 11.13.0 inside the isolated hook prefix, using the released upstream npm fix without weakening Git policy or replacing system npm. Leave working npm versions unchanged.

Keep RUSTUP_HOME alive from toolchain installation through cargo install. Previously install_rust_with_toolchain deleted the downloaded compiler, then cargo received a different empty RUSTUP_HOME and attempted another download. This lifetime bug is reported upstream in #3319. Avoid the redundant sync where the logged cargo proxy aborts with -6; the internal abort cause still requires target-side confirmation, and the original bootstrap test remains enabled.

The npm build-script regression fixture pins Node 26.7.0, whose riscv64 archive is absent. Use available Node 26.0.0 with explicitly installed npm 11.19.0 on riscv64, asserting the npm version so the original regression coverage is retained. Add focused npm-version and Rust-toolchain-lifetime regression tests. Preserve check() unchanged with no additional exclusions.

The latest monferno check fails only test_cmd_output_no_shebang for cmd_output_b and cmd_output_p with "assert 127 == 1". QEMU-user emulates vfork with fork, preventing glibc posix_spawn from propagating the child exec error to Python 3.14.7. Select native builders with qemu-user-blacklist.txt rather than weakening the exit-status assertion, skipping tests, or changing subprocess behavior. Keep the existing bootstrap fixes. CPython #131398 remains open; no applicable upstream fix was found.

https://archriscv.felixc.at/.status/logs/pre-commit/pre-commit-4.6.2-1.log
pre-commit/pre-commit#3758
npm/cli#9206
https://github.com/npm/cli/blob/v11.13.0/CHANGELOG.md
pre-commit/pre-commit#3319
https://github.com/pre-commit/pre-commit/blob/v4.6.2/pre_commit/languages/rust.py
https://github.com/pre-commit/pre-commit/blob/v4.6.2/tests/languages/node_test.py
https://github.com/ekalinin/nodeenv/blob/1.11.0/nodeenv.py
https://unofficial-builds.nodejs.org/download/release/index.json
python/cpython#131398
https://github.com/python/cpython/blob/v3.14.7/Lib/subprocess.py
https://docs.python.org/3.14/library/subprocess.html#subprocess.Popen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@owlstronaut owlstronaut owlstronaut approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

backport:v11

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG] allow-git=root does not allow root level git dependencies to be installed

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@wraithgar @akhenry @owlstronaut
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.