How to Install TypeScript on Windows, macOS and Linux
Installing TypeScript always starts with the same building blocks: install Node.js, confirm that npm works, then install the TypeScript compiler and verify it with tsc -v. The exact commands vary by operating system, so this page is the central guide for choosing the right walkthrough.
If you already know your platform, jump straight to the matching guide: install TypeScript on Windows, install TypeScript on macOS, or install TypeScript on Linux.
Choose Your Platform
- Windows: Use How to Install TypeScript on Windows if you want PowerShell, Command Prompt, or
winget-friendly instructions. - macOS: Use How to Install TypeScript on macOS if you prefer Homebrew or the Node.js installer.
- Linux: Use How to Install TypeScript on Linux if you are working on Ubuntu, Debian, Fedora, RHEL, Rocky Linux, AlmaLinux, or another distribution.
Quick Comparison
| Platform | Typical Node.js Path | Best For |
|---|---|---|
| Windows | Node.js installer or winget | Developer workstations, Visual Studio Code, PowerShell users |
| macOS | Homebrew or Node.js installer | Mac developer laptops, Apple Silicon, Intel Macs |
| Linux | apt, dnf, or distro package manager | Servers, cloud VMs, developer workstations, containers |
Shared Install Flow
- Install Node.js and confirm both
nodeandnpmare available. - Install TypeScript globally with
npm install -g typescript, or use a project-local install withnpm install --save-dev typescript. - Verify the compiler with
tsc -v. - Compile a test file or run
npx tsc --initin a project to generate atsconfig.jsonfile.
npm install -g typescript
tsc -v
Global vs Project-Local TypeScript
A global install is convenient when you want the tsc command available everywhere on your system. A project-local install is usually better for team projects because the TypeScript version is pinned in package.json and stays consistent across environments.
npm install --save-dev typescript
npx tsc --init
Which Guide Should You Read?
Use the OS-specific guides when you need platform-native troubleshooting, such as PATH issues on Windows, Homebrew setup on macOS, or package-manager differences on Linux.
Next Steps
Once TypeScript is installed, create a simple project, generate a tsconfig.json, and compile a small test file. If you work across multiple operating systems, keep this hub bookmarked and use the child guides for the exact commands and troubleshooting notes for each platform.

Recent Comments