{"id":17987,"library":"typescript-language-server","title":"TypeScript Language Server","description":"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.","status":"active","version":"5.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/typescript-language-server/typescript-language-server","tags":["javascript"],"install":[{"cmd":"npm install typescript-language-server","lang":"bash","label":"npm"},{"cmd":"yarn add typescript-language-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add typescript-language-server","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides the underlying `tsserver` API that the language server wraps and depends on for language intelligence. Must be installed alongside the server.","package":"typescript","optional":false},{"reason":"Runtime environment. Version 20 or higher is required since v5.0.0.","package":"node","optional":false}],"imports":[{"note":"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.","wrong":"import { typescriptLanguageServer } from 'typescript-language-server'","symbol":"typescript-language-server","correct":"npm install -g typescript-language-server typescript\ntypescript-language-server --stdio"},{"note":"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.","wrong":"Expecting the language server to bundle 'typescript' automatically.","symbol":"typescript (tsserver)","correct":"npm install -g typescript"},{"note":"Server configuration is typically managed by the LSP client (your editor/IDE) through standardized LSP messages, not direct code imports or local file manipulation.","wrong":"Attempting to modify server behavior by editing local files or environment variables without proper LSP communication.","symbol":"Configuration (LSP)","correct":"(Managed by LSP client through `workspace/didChangeConfiguration` and other LSP messages)"}],"quickstart":{"code":"npm install -g typescript-language-server typescript\n\n# To run the server for an editor/IDE:\ntypescript-language-server --stdio\n\n# Or, to check CLI options:\ntypescript-language-server --help","lang":"bash","description":"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."},"warnings":[{"fix":"Upgrade your Node.js installation to version 20 or later. You can check your current version with `node -v`.","message":"Node.js version 20 or higher is now a hard requirement for the `typescript-language-server`.","severity":"breaking","affected_versions":">=5.0.0"},{"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.","message":"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.","severity":"gotcha","affected_versions":">=1.0.0"},{"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`).","message":"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.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-23T00:00:00.000Z","next_check":"2026-07-22T00:00:00.000Z","problems":[{"fix":"Install the 'typescript' package globally: `npm install -g typescript`, or ensure it's a project dependency and accessible to the server.","cause":"The 'typescript' npm package, which provides 'tsserver', is not installed or not resolvable in the environment where the language server is run.","error":"Error: Cannot find module 'typescript'"},{"fix":"Upgrade your Node.js installation to version 20 or higher. Use `node -v` to check your current Node.js version.","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).","error":"SyntaxError: Unexpected token '?'"},{"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.","cause":"The language server process crashed or failed to start, often due to incorrect installation, missing dependencies, invalid CLI arguments, or configuration errors.","error":"Language server exited unexpectedly. (Common editor message)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}