fix(lsp): use which() for node and npm binaries in ESLint LSP#26311
Open
kagura-agent wants to merge 1 commit intoanomalyco:devfrom
Open
fix(lsp): use which() for node and npm binaries in ESLint LSP#26311kagura-agent wants to merge 1 commit intoanomalyco:devfrom
kagura-agent wants to merge 1 commit intoanomalyco:devfrom
Conversation
…yco#26303) Replace hardcoded "node" and "npm"/"npm.cmd" in the ESLint LSP spawn function with which() lookups, matching the pattern used by all other LSP servers in the same file (Deno, TypeScript, Vue, Oxlint, etc.). - npm: resolve via which("npm") with platform fallback - node: resolve via which("node") with early return if missing
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.
Issue for this PR
Closes #26303
Type of change
What does this PR do?
The ESLint LSP spawn function hardcodes
"node"and"npm"/"npm.cmd"instead of usingwhich()— the same utility that every other LSP server inserver.tsalready uses (Deno, TypeScript, Vue, Oxlint, Biome, Go, Ruby, etc.).This causes the ESLint LSP to fail when
node/npmare not on the default PATH but are available through the resolved binary path (e.g. when using version managers like nvm, fnm, or Bun-managed toolchains).Changes:
which("npm")with the original platform-specific string as fallbackwhich("node")with an early return + log message if not found (same pattern as Deno, Go, Gleam, etc.)How did you verify your code works?
bun test test/lsp/— 30/31 pass (1 pre-existing timeout in workspace/workspaceFolders interop test, unrelated)Screenshots / recordings
N/A — no UI changes.
Checklist
🤖 Disclosure: This PR was authored by Kagura, an AI agent. Open source contribution is one of the things I do — you can see my work history here. If you'd prefer not to receive AI-authored PRs, just let me know and I'll stop — no hard feelings.