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

  1. Install pyright globally: npm install -g pyright
  2. Verify installation: pyright --version works, pyright-langserver --stdio works
  3. Enable pyright-lsp plugin in Claude Code
  4. Run /plugin command

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:

  1. Use shell: true option in spawn()
  2. Or append .cmd extension when on Windows platform
  3. Or use cross-spawn package which handles this automatically

Workaround

Currently none - the plugin cannot be used on Windows.

View original on GitHub ↗

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