claude-code - 💡(How to fix) Fix Windows: LSP servers fail with ENOENT because spawn doesn't resolve .cmd files [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48203Fetched 2026-04-15 06:30:16
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

On Windows, LSP server plugins (e.g. typescript-lsp, php-lsp, kotlin-lsp) fail with:

Error performing documentSymbol: ENOENT: no such file or directory, uv_spawn 'typescript-language-server'

Error Message

Error performing documentSymbol: ENOENT: no such file or directory, uv_spawn 'typescript-language-server'

Root Cause

npm global packages on Windows are installed as .cmd wrapper files (e.g. typescript-language-server.cmd). Node.js child_process.spawn without shell: true does not resolve .cmd files — it looks for an exact executable match.

The marketplace.json defines LSP commands without the .cmd extension:

{
  "typescript": {
    "command": "typescript-language-server",
    "args": ["--stdio"]
  }
}

Fix Action

Workaround

Manually edit marketplace.json to append .cmd to LSP command values, or use a SessionStart hook to patch it automatically. Note that marketplace.json gets overwritten on plugin updates, so manual edits don't persist.

Code Example

Error performing documentSymbol: ENOENT: no such file or directory, uv_spawn 'typescript-language-server'

---

{
  "typescript": {
    "command": "typescript-language-server",
    "args": ["--stdio"]
  }
}
RAW_BUFFERClick to expand / collapse

Description

On Windows, LSP server plugins (e.g. typescript-lsp, php-lsp, kotlin-lsp) fail with:

Error performing documentSymbol: ENOENT: no such file or directory, uv_spawn 'typescript-language-server'

Root Cause

npm global packages on Windows are installed as .cmd wrapper files (e.g. typescript-language-server.cmd). Node.js child_process.spawn without shell: true does not resolve .cmd files — it looks for an exact executable match.

The marketplace.json defines LSP commands without the .cmd extension:

{
  "typescript": {
    "command": "typescript-language-server",
    "args": ["--stdio"]
  }
}

Steps to Reproduce

  1. Install Claude Code on Windows
  2. Enable typescript-lsp plugin
  3. Install typescript-language-server globally: npm install -g typescript-language-server typescript
  4. Try any LSP operation on a .ts file
  5. Get ENOENT: no such file or directory, uv_spawn 'typescript-language-server'

Expected Behavior

LSP servers should start successfully on Windows, just as they do on macOS/Linux.

Suggested Fix

When spawning LSP server processes on Windows, either:

  1. Use shell: true option in child_process.spawn
  2. Use the cross-spawn package
  3. Automatically append .cmd to commands on win32 platform

This is a well-known Node.js issue: https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows

Workaround

Manually edit marketplace.json to append .cmd to LSP command values, or use a SessionStart hook to patch it automatically. Note that marketplace.json gets overwritten on plugin updates, so manual edits don't persist.

Environment

  • OS: Windows 11
  • Claude Code: latest stable
  • Affected plugins: all LSP plugins (typescript-lsp, php-lsp, kotlin-lsp, and others)

extent analysis

TL;DR

Append .cmd to LSP command values in marketplace.json or use shell: true in child_process.spawn to fix the issue.

Guidance

  • Verify the issue by checking the marketplace.json file for LSP command values without the .cmd extension.
  • Manually edit marketplace.json to append .cmd to LSP command values as a temporary workaround.
  • Consider using the cross-spawn package or setting shell: true in child_process.spawn for a more permanent solution.
  • Be aware that manual edits to marketplace.json may not persist after plugin updates.

Example

{
  "typescript": {
    "command": "typescript-language-server.cmd",
    "args": ["--stdio"]
  }
}

Notes

The issue is specific to Windows due to the use of .cmd wrapper files for npm global packages. The suggested fix should be applied to all affected LSP plugins.

Recommendation

Apply the workaround by appending .cmd to LSP command values in marketplace.json until a more permanent solution can be implemented, as it is a straightforward and effective fix.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING