LSP plugins fail on Windows: spawn() cannot resolve npm .cmd shims (ENOENT)
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
- Install an LSP plugin (e.g.,
typescript-lsporpyright-lsp) - Install the LSP server globally:
npm install -g typescript-language-server typescript - Restart Claude Code
- 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.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗