typescript-lsp plugin fails on Windows: spawn ENOENT for npm global binaries
Status Closed — duplicate
Reported on v2.1.14
Maintainer reply ✓ Yes — claude[bot]
Workaround ✓ Mentioned in thread ↓
Activity 15 comments · opened Jan 21, 2026 · closed May 10, 2026
💡 Likely answer: A maintainer (claude[bot], contributor)
responded on this thread — see the highlighted reply below.
Description
The typescript-lsp plugin fails to start on Windows with the error:
LSP server plugin:typescript-lsp:typescript failed to start: ENOENT: no such file or directory, uv_spawn 'typescript-language-server'
Root Cause
On Windows, npm installs global packages with .cmd wrapper scripts (batch files), not executable binaries. When Claude Code's LSP manager uses Node.js spawn() without shell: true, it cannot find the .cmd files because:
- Node.js
spawn()without shell only looks for actual executables (.exe) - npm creates
typescript-language-server.cmd(batch file), nottypescript-language-server.exe - While cmd.exe respects PATHEXT and finds
.cmdfiles, Node.jsspawn()does not
Reproduction
// This fails on Windows:
const { spawn } = require('child_process');
spawn('typescript-language-server', ['--version']); // ENOENT
// This works:
spawn('typescript-language-server', ['--version'], { shell: true }); // OK
spawn('typescript-language-server', ['--version'], { shell: 'cmd.exe' }); // OK
Environment
- OS: Windows 11 (build 26220)
- Claude Code: 2.1.14
- Node.js: 24.3.0
- typescript-language-server: 5.1.3 (installed globally via npm)
Suggested Fix
The LSP manager should use shell: true (or shell: 'cmd.exe') when spawning language servers on Windows. This allows the shell to resolve .cmd wrapper scripts.
Alternatively, the plugin could explicitly look for the .cmd extension on Windows:
const command = process.platform === 'win32'
? 'typescript-language-server.cmd'
: 'typescript-language-server';
Workaround
Created a .NET shim executable (typescript-language-server.exe) that calls the .cmd file via cmd.exe. This allows Node.js spawn() to find and execute it.
Showing cached comments. Read the full discussion on GitHub ↗
14 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
There are multiple dupes of this issue that affects multiple LSP plugins. Multiple of these dupes, like this defect have suggested fixes. Why aren't these fixes being implemented?
I encountered the same issue on Windows 11 (Build 10.0.26200.7628) with Claude Code 2.1.31.
Root Cause Analysis:
On Windows, npm installs global packages with
.cmdbatch wrapper scripts (e.g.,typescript-language-server.cmd) instead of.exeexecutables. Node.js'sspawn()function, withoutshell: trueoption, only looks for actual executables (.exe), causing the ENOENT error.Suggested Fix:
When spawning LSP servers on Windows, either:
shell: trueoption inspawn().cmdfiles on Windows platformThis affects not just TypeScript LSP but potentially any npm-installed language server.
Workaround: Edit
marketplace.jsondirectlyFound a fix for this on Windows. The issue is that
typescript-language-serveris installed as a.cmdfile atAppData\Roaming\npm\typescript-language-server.cmd, and Node.jsspawn()can't resolve.cmdfiles withoutshell: true.User-side workaround:
Edit
~/.claude/plugins/marketplaces/claude-plugins-official/.claude-plugin/marketplace.jsonand change the typescript-lsp entry from:to:
Restart Claude Code. LSP diagnostics should start working — confirmed on Windows 10 with Claude Code 2.1.38 (native binary).
Note: You may also need
"ENABLE_LSP_TOOL": "1"in your~/.claude/settings.jsonenv block.The proper upstream fix would be adding
shell: true(or{ shell: 'cmd.exe' }) to thespawn()call whenprocess.platform === 'win32'— this would fix it for all npm-installed language servers on Windows, not just TypeScript.See also #15202 for the related timing bug where LSP manager initializes before plugins finish loading.
Still reproduces as of 2.1.45
still the case with 2.1.63
@HaNagid thanks man, your fix works for typescript lsp, is there a similar fix for python lsp ?
Still an issue for me as well.
Claude Code version: 2.1.81
OS: Windows 11 Pro (Build 26200)
Shell: Git Bash (MSYS2)
Node: v20.18.0 (via nvm4w)
npm: 10.8.2
Confirming that @HaNagid's workaround worked for me too 😄 Hope this gets an official fix so Windows users can have typescript-lsp work off-the-shelf without tracking down this issue.
Still an issue on my end as wel on version 2.1.83
Is this issue being worked on or is this another confirmation that LLM without proper engineers is an ongoing trainwreck that's going to cause a complete breakdown of society due to the competency crisis?
---
Workaround for Windows LSP plugin ENOENT (tested with php-lsp, should work for all npm-installed LSP servers)
Root cause: On Windows, npm install -g creates .cmd batch wrappers (e.g. intelephense.cmd), not .exe executables.
Node.js child_process.spawn() without shell: true only resolves .exe files via PATHEXT, so spawn('intelephense') fails
with ENOENT even though intelephense.cmd exists and works fine from a terminal.
Workaround: Create a plugin.json in the cached plugin directory that wraps the command with cmd /c, which lets cmd.exe
handle the .cmd resolution:
mkdir -p ~/.claude/plugins/cache/claude-plugins-official/php-lsp/1.0.0/.claude-plugin
```json
{
"name": "php-lsp",
"version": "1.0.0",
"description": "PHP language server (Intelephense) for code intelligence",
"author": {
"name": "Anthropic",
"email": "support@anthropic.com"
},
"lspServers": {
"intelephense": {
"command": "cmd",
"args": ["/c", "intelephense", "--stdio"],
"extensionToLanguage": {
".php": "php"
}
}
}
}
This is a duplicate of #17312, which was fixed as of version 2.1.132.
It wasn't fixed.
Still broken in v2.1.161 on Windows 11 — affects both typescript-lsp and php-lsp
Confirming the issue persists on:
typescript-language-server@5.3.0andintelephense@1.18.4installed globally via npmC:\Users\<user>\AppData\Roaming\npmpresent in Windows user PATHBoth
typescript-lsp@claude-plugins-officialandphp-lsp@claude-plugins-officialfail identically:The
.cmdworkaround (editingmarketplace.json) does resolve the issue but gets overwritten on marketplace updates — so it's not a viable long-term solution.cross-spawnorshell: trueon Windows would be a one-line fix on Anthropic's side.