TypeScript Language Server

raw JSON →
5.1.3 verified Thu Apr 23 auth: no javascript

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.

error Error: Cannot find module 'typescript'
cause The 'typescript' npm package, which provides 'tsserver', is not installed or not resolvable in the environment where the language server is run.
fix
Install the 'typescript' package globally: npm install -g typescript, or ensure it's a project dependency and accessible to the server.
error SyntaxError: Unexpected token '?'
cause The `typescript-language-server` (especially versions 5.0.0 and above) is being run with an older Node.js version that does not support its syntax or required APIs (e.g., Node.js < 20).
fix
Upgrade your Node.js installation to version 20 or higher. Use node -v to check your current Node.js version.
error Language server exited unexpectedly. (Common editor message)
cause The language server process crashed or failed to start, often due to incorrect installation, missing dependencies, invalid CLI arguments, or configuration errors.
fix
Check the server's logs for specific errors (e.g., run typescript-language-server --stdio --log-level 4). Ensure Node.js and 'typescript' are correctly installed, and verify your editor's LSP client configuration.
breaking Node.js version 20 or higher is now a hard requirement for the `typescript-language-server`.
fix Upgrade your Node.js installation to version 20 or later. You can check your current version with `node -v`.
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.
fix Always install `typescript` alongside `typescript-language-server` (e.g., `npm install -g typescript-language-server typescript`) or ensure your editor's LSP client is configured to use a specific, compatible TypeScript version.
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.
fix Understand its role as an independent LSP wrapper for `tsserver`; direct bug reports and feature requests to the correct GitHub repository (`typescript-language-server/typescript-language-server`).
npm install typescript-language-server
yarn add typescript-language-server
pnpm add typescript-language-server

This demonstrates the global installation of the TypeScript Language Server and its required 'typescript' dependency, then shows how to invoke the server in standard I/O mode for editor integration, or view CLI options.

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