[PR #6366] fix(lsp): ESLint LSP server fails to auto-install on Windows #11858

Closed
opened 2026-02-16 18:16:47 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6366

State: closed
Merged: Yes


Summary

  • Use npm.cmd instead of npm on Windows for running install and compile commands during ESLint LSP server installation
  • Remove invalid --max-old-space-size V8 flag (Bun uses JavaScriptCore, not V8)

Problem

On Windows, npm is actually npm.cmd (a batch file wrapper). Bun's shell may not correctly resolve bare npm commands, causing the ESLint server installation to fail silently.

Additionally, the --max-old-space-size=8192 flag is a V8/Node.js flag, but Bun uses JavaScriptCore. This flag is ignored or could cause unexpected behavior.

Solution

const npmCmd = process.platform === "win32" ? "npm.cmd" : "npm"
await $`${npmCmd} install`.cwd(finalPath).quiet()
await $`${npmCmd} run compile`.cwd(finalPath).quiet()

This follows the same pattern used by other LSP implementations in the codebase (e.g., Oxlint at line 232-234).

Fixes #6365

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6366 **State:** closed **Merged:** Yes --- ## Summary - Use `npm.cmd` instead of `npm` on Windows for running install and compile commands during ESLint LSP server installation - Remove invalid `--max-old-space-size` V8 flag (Bun uses JavaScriptCore, not V8) ## Problem On Windows, `npm` is actually `npm.cmd` (a batch file wrapper). Bun's shell may not correctly resolve bare `npm` commands, causing the ESLint server installation to fail silently. Additionally, the `--max-old-space-size=8192` flag is a V8/Node.js flag, but Bun uses JavaScriptCore. This flag is ignored or could cause unexpected behavior. ## Solution ```typescript const npmCmd = process.platform === "win32" ? "npm.cmd" : "npm" await $`${npmCmd} install`.cwd(finalPath).quiet() await $`${npmCmd} run compile`.cwd(finalPath).quiet() ``` This follows the same pattern used by other LSP implementations in the codebase (e.g., Oxlint at line 232-234). Fixes #6365
yindo added the pull-request label 2026-02-16 18:16:47 -05:00
yindo closed this issue 2026-02-16 18:16:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11858