Repository navigation
Conversation
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
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.
Fixes
Fixes #10189
What
Git for Windows 2.56+ switched the default MSYS2 runtime so
MSYSTEMisUCRT64instead ofMINGW64.lib/utils/is-windows.jsonly treatedMINGW(32|64)as a unix-like Git Bash shell, so on UCRT64:isWindowsShellwastruenpm completionthrewENOTSUP(completion supported only in MINGW / Git bash on Windows)This PR also treats
CLANG32/CLANG64/CLANGARM64the same way (other MSYS2 environments shipped with Git for Windows / MSYS2).Changes
lib/utils/is-windows.js: recognize UCRT64 + CLANG* viaisGitBashMsystemtest/lib/utils/is-windows.js: unit coverage for the helper andisWindowsShellunder UCRT64Testing
tap test/lib/utils/is-windows.js --no-coverage(tap@16.3.9) — passnpm testsuite locally (large; relying on CI)MSYSTEM=UCRT64diagnosisAI 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.