LSP plugins fail on Windows: spawn ENOENT for npm global binaries

Resolved 💬 7 comments Opened Mar 15, 2026 by ShahriarBijoy Closed May 10, 2026

Bug Description

LSP plugins (e.g., typescript-lsp@claude-plugins-official) fail to start on Windows because the process is spawned without shell: true, which prevents resolution of .cmd wrappers that npm uses for global binaries.

Environment

  • OS: Windows 11 Pro
  • Claude Code: Latest
  • Plugin: typescript-lsp@claude-plugins-official v1.0.0
  • Binary: typescript-language-server v5.1.3 (installed globally via npm)

Steps to Reproduce

  1. Install the TypeScript LSP plugin: claude plugins install typescript-lsp@claude-plugins-official
  2. Install the language server: npm install -g typescript-language-server typescript
  3. Verify the binary works from the shell: typescript-language-server --version5.1.3
  4. Use the LSP tool in Claude Code → fails

Error

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

Subsequent attempts show:

Error performing documentSymbol: Failed to sync file open: Cannot send notification to LSP server 'plugin:typescript-lsp:typescript': server is error

Root Cause

On Windows, npm install -g creates three files for each binary:

  • typescript-language-server (POSIX shell script)
  • typescript-language-server.cmd (Windows batch wrapper)
  • typescript-language-server.ps1 (PowerShell wrapper)

Claude Code's LSP plugin appears to spawn the process using child_process.spawn() without { shell: true }. Without a shell, Windows cannot resolve .cmd extensions or execute shell scripts, resulting in ENOENT.

Comparison

Other AI coding tools (e.g., OpenCode) successfully launch the same LSP servers on the same Windows machine, likely because they spawn with shell: true or via cmd.exe, which handles .cmd resolution automatically.

Expected Behavior

LSP servers installed via npm install -g should work on Windows.

Suggested Fix

Either:

  1. Pass { shell: true } to child_process.spawn() when launching LSP servers on Windows
  2. On Windows, automatically append .cmd to the command name if the bare name isn't found
  3. Resolve the binary path using which/where before spawning

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗