fix(update): detect npm-global install on Windows Git Bash via path f…#1358
Open
AmariahAK wants to merge 1 commit into
Open
fix(update): detect npm-global install on Windows Git Bash via path f…#1358AmariahAK wants to merge 1 commit into
AmariahAK wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 621c90b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20ad0b2349
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…allback
When execFile('npm.cmd', ...) throws EINVAL on Windows Git Bash/MSYS2,
detectInstallSource() now falls back to a path-based heuristic before
returning 'unsupported'. Uses a Windows-specific npm/node_modules/
pattern (platform-guarded) alongside the existing /lib/node_modules/
check instead of a broad node_modules/ suffix, preventing false
matches on project-local installs.
Fixes MoonshotAI#1356
Author
|
@wbxl2000 & @liruifengv could you kindly review |
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.
Related Issue
Resolve #1356
Problem
On Windows Git Bash (MSYS2),
kimi updatealways reports'unsupported'even when installed vianpm install -g.execFile("npm.cmd", ...)throwsEINVALunder MSYS2 — the catch block unconditionally returned'unsupported'.The initial fix added a path-based fallback, but Codex review found it was too broad:
endsWith('/node_modules/...')matched anynode_modulesdirectory (including project-local).What changed
Two-part fix inside the
catchblock indetectInstallSource():endsWith('/lib/node_modules/...')(already global-specific)includes('/npm/node_modules/...')guarded byplatform === 'win32', which matches the distinctiveAppData/Roaming/npm/node_modules/global path without triggering on project-local installsZero subprocess spawns, strictly additive (only activates when
npm prefix -gfails).Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.