Registry / web-framework / typescript-language-server

typescript-language-server

JSON →
library5.1.3jsnpmunverified

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.

npm install typescript-language-server
INSTALL
IMPORT
SIG · TYPESCRIPT-LANGUAG
T
typescript-language-server
web-frameworkjavascriptv5.1.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

typescript-language-server
npm install -g typescript-language-server typescript typescript-language-server --stdio
import { typescriptLanguageServer } from 'typescript-language-server'
This package provides a command-line executable that communicates via Language Server Protocol (LSP), not a JavaScript module for programmatic import. Its primary usage is via CLI for editor integration.
typescript (tsserver)
npm install -g typescript
Expecting the language server to bundle 'typescript' automatically.
The language server relies on the `tsserver` API provided by the `typescript` npm package, which must be installed and resolvable in the execution environment for full functionality.
Configuration (LSP)
(Managed by LSP client through `workspace/didChangeConfiguration` and other LSP messages)
Attempting to modify server behavior by editing local files or environment variables without proper LSP communication.
Server configuration is typically managed by the LSP client (your editor/IDE) through standardized LSP messages, not direct code imports or local file manipulation.

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
typescript-language-server --version
Debug
Known issues
breakingNode.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`.
affects: >=5.0.0
gotchaThe 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.
affects: >=1.0.0
gotchaThis 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`).
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'typescript'
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.
SyntaxError: Unexpected token '?'
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.
Language server exited unexpectedly. (Common editor message)
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.
Upgrade
Version history
5.1.3latest on npm
Audit
Dependencies
typescriptrequiredProvides the underlying `tsserver` API that the language server wraps and depends on for language intelligence. Must be installed alongside the server.
noderequiredRuntime environment. Version 20 or higher is required since v5.0.0.
Agent activity
6 hits · last 30 days
node
6
Resources
typescript-language-server — npm install typescript-language-server · libregistry