Requirements
TypeScript requires Node.js version 14.17 or higher to run. Check your Node.js version:Install TypeScript
Choose your package manager
Install TypeScript globally or as a dev dependency in your project:
Installing as a dev dependency (
-D flag) is recommended for project-specific TypeScript versions. For global installation, use npm install -g typescript.Nightly Builds
Get the latest features and bug fixes by installing nightly builds:What Gets Installed
When you install TypeScript, you get two main command-line tools:tsc
The TypeScript compiler that transforms
.ts files into JavaScripttsserver
The TypeScript language server for editor support and tooling
bin/ directory of the installed package:
bin/tsc- TypeScript compilerbin/tsserver- Language server for IDE integration
Global Installation
For system-wide access to TypeScript commands:tsc directly without npx:
Updating TypeScript
Keep TypeScript up to date to get the latest language features and improvements:Troubleshooting
Command not found
Iftsc is not recognized after installation:
-
Use npx for local installations:
-
Check PATH for global installations:
Ensure this directory is in your system PATH.
-
Reinstall TypeScript:
Version mismatch
If different versions appear in global vs local installations:npx tsc in projects to use the local version.
Next Steps
Quickstart
Create your first TypeScript project
tsconfig.json
Configure compiler options