Skip to content

fix: treat UCRT64 Git Bash as a unix shell on Windows - #10191

Open
ump45nose wants to merge 1 commit into
npm:latestfrom
ump45nose:fix/10189-ucrt64-git-bash
Open

ump45nose wants to merge 1 commit into
npm:latestfrom
ump45nose:fix/10189-ucrt64-git-bash

Conversation

@ump45nose

Copy link
Copy Markdown
Contributor

Fixes

Fixes #10189

What

Git for Windows 2.56+ switched the default MSYS2 runtime so MSYSTEM is UCRT64 instead of MINGW64. lib/utils/is-windows.js only treated MINGW(32|64) as a unix-like Git Bash shell, so on UCRT64:

  • isWindowsShell was true
  • npm completion threw ENOTSUP (completion supported only in MINGW / Git bash on Windows)

This PR also treats CLANG32 / CLANG64 / CLANGARM64 the same way (other MSYS2 environments shipped with Git for Windows / MSYS2).

Changes

  • lib/utils/is-windows.js: recognize UCRT64 + CLANG* via isGitBashMsystem
  • test/lib/utils/is-windows.js: unit coverage for the helper and isWindowsShell under UCRT64

Testing

  • tap test/lib/utils/is-windows.js --no-coverage (tap@16.3.9) — pass
  • Plain Node assert regression for UCRT64 / MINGW64 / CLANG64 / cmd paths — pass
  • Not re-run full npm test suite locally (large; relying on CI)
  • No physical Windows Git Bash 2.56 host in this environment; logic matches the reporter's MSYSTEM=UCRT64 diagnosis

AI disclosure

This change was prepared with AI assistance (Grok Bot / Cursor agent). I reviewed the diff, wrote/ran the regression tests above, and believe the fix matches the issue.

Git for Windows 2.56+ defaults MSYSTEM to UCRT64 instead of MINGW64.
isWindowsShell only excluded MINGW(32|64), so `npm completion` (and
other shell-sensitive paths) incorrectly treated UCRT64 Git Bash as
cmd.exe and threw ENOTSUP.

Also recognize CLANG32/64/ARM64 MSYS2 environments the same way.

Fixes npm#10189
@ump45nose
ump45nose requested a review from a team as a code owner October 29, 2026 19:25
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] npm completion no longer works in Git Bash 2.56.0 on Windows

1 participant