Windows: pyright-lsp plugin fails with ENOENT - cannot spawn .cmd files
Resolved 💬 10 comments Opened Jan 8, 2026 by hwanoKim Closed May 10, 2026
Bug Description
The pyright-lsp plugin fails on Windows with spawn pyright-langserver ENOENT error, even though pyright-langserver is correctly installed and accessible from the command line.
Environment
- OS: Windows 10/11
- Claude Code Version: Latest
- Node.js: Installed via official installer
- Pyright: Installed via
npm install -g pyright
Steps to Reproduce
- Install pyright globally:
npm install -g pyright - Verify installation:
pyright --versionworks,pyright-langserver --stdioworks - Enable pyright-lsp plugin in Claude Code
- Run
/plugincommand
Expected Behavior
The pyright-lsp plugin should start successfully.
Actual Behavior
Plugin Errors
> plugin:pyright-lsp:pyright
spawn pyright-langserver ENOENT
Root Cause Analysis
On Windows, npm installs global packages with .cmd wrapper files (e.g., pyright-langserver.cmd). Node.js child_process.spawn() cannot execute .cmd files directly without the shell: true option.
The command exists and works:
> where pyright-langserver
C:\Users\<user>\AppData\Roaming\npm\pyright-langserver
C:\Users\<user>\AppData\Roaming\npm\pyright-langserver.cmd
> pyright-langserver --stdio
(works - connects to stdin/stdout)
Suggested Fix
When spawning LSP servers on Windows, either:
- Use
shell: trueoption in spawn() - Or append
.cmdextension when on Windows platform - Or use
cross-spawnpackage which handles this automatically
Workaround
Currently none - the plugin cannot be used on Windows.
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗