LSP tool fails to spawn typescript-language-server on Windows (missing .cmd extension)

Resolved 💬 3 comments Opened Mar 12, 2026 by FaustoMendezcom Closed Mar 12, 2026

Bug Description

The LSP tool fails on Windows when trying to spawn typescript-language-server because it doesn't append the .cmd extension. On Windows, npm global installs create .cmd wrapper scripts, so the binary must be invoked as typescript-language-server.cmd (or spawned with shell: true).

Steps to Reproduce

  1. Install typescript-language-server globally on Windows: npm install -g typescript-language-server
  2. Verify it exists: where typescript-language-server.cmdC:\Users\...\AppData\Roaming\npm\typescript-language-server.cmd
  3. Use the LSP tool on any .ts/.tsx file (e.g., documentSymbol operation)

Expected Behavior

The LSP tool should find and spawn typescript-language-server.cmd on Windows.

Actual Behavior

Error performing documentSymbol: ENOENT: no such file or directory, uv_spawn 'typescript-language-server'

The tool tries to spawn typescript-language-server (without .cmd), which doesn't exist on Windows.

Suggested Fix

When spawning LSP server processes on Windows, either:

  • Use shell: true in the spawn/execFile options (Node.js will resolve .cmd automatically), or
  • Append .cmd to the executable name on win32 platform

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Platform: win32
  • Shell: bash (Git Bash)
  • typescript-language-server location: C:\Users\FM\AppData\Roaming\npm\typescript-language-server.cmd

View original on GitHub ↗

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