LSP plugins fail on Windows: spawn() cannot resolve npm .cmd shims (ENOENT)

Resolved 💬 6 comments Opened Mar 16, 2026 by darcydubuc Closed May 10, 2026

Description

LSP plugins (e.g., typescript-language-server, pyright) fail to start on Windows with ENOENT errors because Node.js child_process.spawn() is called without shell: true.

On Windows, npm-installed global binaries are .cmd shell scripts (shims), not direct executables. Node's spawn() without shell: true cannot resolve these .cmd files, resulting in ENOENT.

Environment

  • Windows 11 Pro (10.0.26200)
  • Claude Code 2.1.69
  • Node.js (bundled with Claude Code)
  • npm-installed LSP servers: typescript-language-server@5.1.3, pyright@1.1.408

Steps to Reproduce

  1. Install an LSP plugin (e.g., typescript-lsp or pyright-lsp)
  2. Install the LSP server globally: npm install -g typescript-language-server typescript
  3. Restart Claude Code
  4. The LSP server fails to start with an ENOENT error

Expected Behavior

LSP servers should start successfully on Windows, resolving .cmd shims the same way they work on macOS/Linux.

Likely Fix

Add shell: true to the spawn() options when launching LSP server processes on Windows. This is the standard Node.js workaround for .cmd shim resolution.

For reference, the Coda MCP server (a user-built MCP) encountered the same issue when spawning claude -p on Windows and resolved it with shell: true.

View original on GitHub ↗

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