TypeScript Language Server
raw JSON →The TypeScript Language Server provides a Language Server Protocol (LSP) implementation for TypeScript and JavaScript projects, acting as a bridge between editors and Microsoft's `tsserver` component. It allows any LSP-compliant editor to leverage the rich code intelligence features originally developed for VSCode, which internally uses `tsserver` via a non-standard API. This project wraps that functionality in a standard LSP interface, making it accessible to a wider ecosystem of editors. The current stable version is 5.1.3, released in November 2025, with a consistent cadence of patch and minor updates following its major v5.0.0 release in September 2025. Key differentiators include its role in standardizing `tsserver` access via LSP and its community-maintained status, separate from Microsoft's official tooling. Developers should note that while it uses `tsserver`, it is not the same as the built-in TypeScript features extension in VSCode, and a future, Go-based TypeScript 7 from Microsoft may eventually offer a native LSP implementation that could supersede this project.
Common errors
error Error: Cannot find module 'typescript' ↓
npm install -g typescript, or ensure it's a project dependency and accessible to the server. error SyntaxError: Unexpected token '?' ↓
node -v to check your current Node.js version. error Language server exited unexpectedly. (Common editor message) ↓
typescript-language-server --stdio --log-level 4). Ensure Node.js and 'typescript' are correctly installed, and verify your editor's LSP client configuration. Warnings
breaking Node.js version 20 or higher is now a hard requirement for the `typescript-language-server`. ↓
gotcha The functionality of the language server is tightly coupled with the installed `typescript` package, which provides `tsserver`. Incompatibilities can arise if mismatched versions are used. ↓
gotcha This project is not directly associated with Microsoft, nor is it the built-in TypeScript Language Features extension in VSCode. Issues specific to VSCode's internal TypeScript handling should be reported in the VSCode repository. ↓
Install
npm install typescript-language-server yarn add typescript-language-server pnpm add typescript-language-server Imports
- typescript-language-server wrong
import { typescriptLanguageServer } from 'typescript-language-server'correctnpm install -g typescript-language-server typescript typescript-language-server --stdio - typescript (tsserver) wrong
Expecting the language server to bundle 'typescript' automatically.correctnpm install -g typescript - Configuration (LSP) wrong
Attempting to modify server behavior by editing local files or environment variables without proper LSP communication.correct(Managed by LSP client through `workspace/didChangeConfiguration` and other LSP messages)
Quickstart
npm install -g typescript-language-server typescript
# To run the server for an editor/IDE:
typescript-language-server --stdio
# Or, to check CLI options:
typescript-language-server --help