Practical Linux, Windows Server and cloud guides for IT pros.

How to Install TypeScript on Windows: Step-by-Step Guide

This guide is specifically for Windows users who want to install TypeScript cleanly and verify that the compiler works in PowerShell or Command Prompt. If you want the cross-platform overview first, start with How to Install TypeScript on Windows, macOS and Linux.

Filed under

Published

Written by

typescript logo

This guide is specifically for Windows users who want to install TypeScript cleanly and verify that the compiler works in PowerShell or Command Prompt. If you want the cross-platform overview first, start with How to Install TypeScript on Windows, macOS and Linux. For the other operating systems, use the guides for macOS and Linux.

Quick Answer

  1. Download and install Node.js from nodejs.org (includes npm)
  2. Open Command Prompt or PowerShell and install TypeScript: npm install -g typescript
  3. Verify: tsc --version
  4. Compile a TypeScript file: tsc yourfile.ts

Before You Start

TypeScript is installed through npm, so you need Node.js on your Windows machine first. The two easiest methods are the Node.js installer or winget.

Option 1: Install Node.js with winget

If you already use modern Windows package management, this is usually the fastest approach.

winget install OpenJS.NodeJS.LTS
node -v
npm -v

Option 2: Install Node.js with the Official Windows Installer

Download the current LTS release from the official Node.js website, run the installer, and keep the option that adds Node.js to your system PATH enabled. Then open a new PowerShell or Command Prompt window and verify the install:

node -v
npm -v

Install TypeScript Globally

Once Node.js is ready, install TypeScript globally:

npm install -g typescript
tsc -v

This makes the TypeScript compiler available system-wide.

Install TypeScript Per Project

If you want a cleaner project-level setup, create a folder and install TypeScript locally:

mkdir my-typescript-project
cd my-typescript-project
npm init -y
npm install --save-dev typescript
npx tsc --init

This is usually the better option for real applications because every project can pin its own compiler version.

Verify the Compiler in PowerShell

Create a test file and compile it:

Set-Content hello.ts 'const message: string = "TurboGeek";'
tsc hello.ts
Get-ChildItem

You should see a generated hello.js file after compilation.

Troubleshooting on Windows

  • npm is not recognized: reopen PowerShell or Command Prompt after installing Node.js.
  • tsc is not recognized: verify that the global npm bin directory is on your PATH, or use npx tsc inside a project.
  • Permission issues: open PowerShell as Administrator only if you genuinely need it; for most installs, standard user permissions are enough.
npx tsc -v

Related TypeScript Guides

Once TypeScript is installed on Windows, the next job is setting up a project with tsconfig.json, an editor like Visual Studio Code, and a build or linting workflow that matches your stack.

Elsewhere On TurboGeek:  How to Install TypeScript on Linux (npm, apt and dnf Guide)

Find more on the site

Keep reading by topic.

If this post was useful, the fastest way to keep going is to pick the topic you work in most often.

Want another useful post?

Browse the latest posts, or support TurboGeek if the site saves you time regularly.

Translate ยป