claude-code - 💡(How to fix) Fix typescript-lsp plugin: ENOENT on Windows due to bare command name failing to resolve npm .cmd shim

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The official typescript-lsp plugin in the claude-plugins-official marketplace is unusable on Windows out of the box. Every LSP call returns:

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

even though typescript-language-server is installed globally via npm and resolvable on PATH from any shell.

Root Cause

marketplace.json declares:

"lspServers": {
  "typescript": {
    "command": "typescript-language-server",
    "args": ["--stdio"],
    ...
  }
}

npm install -g typescript-language-server installs the binary to %APPDATA%\npm\ as three files:

  • typescript-language-server (POSIX shell shim)
  • typescript-language-server.cmd (Windows cmd shim) ← the one Windows actually executes
  • typescript-language-server.ps1 (PowerShell shim)

Node's child_process.spawn(cmd) without shell: true does not resolve .cmd files via PATHEXT. Only cmd.exe does that. So spawning the bare name typescript-language-server on Windows fails with ENOENT, even though the binary is on PATH and runs fine from a shell.

Fix Action

Workaround

Edit ~/.claude/plugins/marketplaces/claude-plugins-official/.claude-plugin/marketplace.json and change the typescript-lsp command field from "typescript-language-server" to "typescript-language-server.cmd". Then /reload-plugins. Works immediately.

This workaround gets overwritten whenever the plugin/marketplace updates and must be re-applied.

Code Example

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

---

"lspServers": {
  "typescript": {
    "command": "typescript-language-server",
    "args": ["--stdio"],
    ...
  }
}
RAW_BUFFERClick to expand / collapse

Summary

The official typescript-lsp plugin in the claude-plugins-official marketplace is unusable on Windows out of the box. Every LSP call returns:

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

even though typescript-language-server is installed globally via npm and resolvable on PATH from any shell.

Root cause

marketplace.json declares:

"lspServers": {
  "typescript": {
    "command": "typescript-language-server",
    "args": ["--stdio"],
    ...
  }
}

npm install -g typescript-language-server installs the binary to %APPDATA%\npm\ as three files:

  • typescript-language-server (POSIX shell shim)
  • typescript-language-server.cmd (Windows cmd shim) ← the one Windows actually executes
  • typescript-language-server.ps1 (PowerShell shim)

Node's child_process.spawn(cmd) without shell: true does not resolve .cmd files via PATHEXT. Only cmd.exe does that. So spawning the bare name typescript-language-server on Windows fails with ENOENT, even though the binary is on PATH and runs fine from a shell.

Reproduction

  • Windows 11
  • Node 20+
  • Claude Code latest
  • npm install -g typescript-language-server typescript
  • /plugin install typescript-lsp@claude-plugins-official
  • /reload-plugins
  • Any LSP operation (hover, goToDefinition, findReferences, etc.) → ENOENT

Workaround

Edit ~/.claude/plugins/marketplaces/claude-plugins-official/.claude-plugin/marketplace.json and change the typescript-lsp command field from "typescript-language-server" to "typescript-language-server.cmd". Then /reload-plugins. Works immediately.

This workaround gets overwritten whenever the plugin/marketplace updates and must be re-applied.

Suggested fix

Any of:

  1. Spawn with shell: true on process.platform === 'win32'.
  2. Use cross-spawn — handles this exact case.
  3. Auto-resolve .cmd / .ps1 / .exe via PATHEXT on Windows before spawning.
  4. Allow user-level override of lspServers[*].command in settings.json (also useful for users who install the binary in non-standard locations).

Option 2 (cross-spawn) is the most common fix in the Node ecosystem for this exact bug.

Impact

Every Windows user who installs typescript-lsp from the official marketplace hits this and gets a fully non-functional plugin until they discover the workaround. It's the single most-installed LSP plugin in the marketplace, so the blast radius is broad.

extent analysis

TL;DR

The most likely fix is to use the cross-spawn package to handle the spawning of the typescript-language-server command on Windows.

Guidance

  • The issue is caused by Node's child_process.spawn not resolving .cmd files via PATHEXT on Windows, so using cross-spawn can handle this case.
  • To verify the fix, install cross-spawn and update the typescript-lsp plugin to use it, then test LSP operations on Windows.
  • As a temporary workaround, editing the marketplace.json file to change the command field to "typescript-language-server.cmd" can resolve the issue, but this will be overwritten on plugin updates.
  • Consider allowing user-level override of lspServers[*].command in settings.json for more flexibility.

Example

No code snippet is provided as the issue is more related to configuration and package usage.

Notes

The suggested fix using cross-spawn is a common solution in the Node ecosystem for this exact bug, and it's recommended to use this package to handle the spawning of commands on Windows.

Recommendation

Apply the workaround by using the cross-spawn package, as it is a well-established solution for this issue and will provide a more robust fix.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING