[Windows] TypeScript LSP issues: ENOENT spawn error and non-functional LSP operations
Environment
- Claude Code Version: 2.1.31
- OS: Windows 11 (Build 10.0.26200.7628)
- Node.js: v22.20.0
- npm: 10.9.3
Summary
Two related TypeScript LSP issues on Windows platform:
- ENOENT Error: 2. LSP Operations Not Working: Most LSP operations return no results even when the server is running
---
Issue 1: spawn typescript-language-server ENOENT
Description
On Windows, attempting to use LSP features results in:
\
Root Cause
This is a Windows-specific issue:
- When npm installs global packages on Windows, it creates \ batch wrapper scripts (e.g., \) instead of \ executables
- Node.js's \ function, without \ option, only looks for actual executables (\)
- Therefore, when Claude Code attempts to execute \, it cannot find the file, resulting in ENOENT error
Suggested Fix
When spawning \ on Windows, either:
- Use \ option in - Or explicitly look for \ files on Windows platform
---
Issue 2: LSP Operations Return No Results
Description
Even when the TypeScript LSP server is running (confirmed via Task Manager showing \ process), most LSP operations fail to return results on Windows.
Reproduction Steps
- Open a TypeScript project on Windows
- Try various LSP operations on a valid \ file
Test Results Comparison
| Operation | macOS | Windows |
|-----------|-------|---------|
| \ | ✅ Works | ✅ Works |
| \ | ✅ Works | ❌ "No symbols found" |
| \ | ✅ Works | ❌ "No definition found" |
| \ | ✅ Works | ⚠️ No output |
| \ | ✅ Works | ❌ "No references found" |
| \ | ✅ Works | ❌ "No definition found" |
| \ | ✅ Works | ❌ "No call hierarchy item found" |
| \ | ✅ Works | ❌ "No call hierarchy item found" |
Observations
- \ is the only operation that works correctly on Windows
- The LSP server process (\) is confirmed running
- The project has valid \ and \ installed
- Same project works perfectly on macOS
Possible Causes
- Path format issues: Windows uses backslashes (\) while LSP may expect forward slashes (\)
- Working directory resolution: Project root identification may differ on Windows
- TypeScript project initialization: LSP may not properly load \ on Windows
- File URI handling: Windows file URIs may not be correctly formatted
---
Additional Context
Tested on the same codebase (MidwayJS TypeScript project) on both macOS and Windows. The issue is reproducible and consistent on Windows.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗