Setting Up TypeScript
Purpose: get a working TypeScript environment. Benefit: you can compile and run your first TypeScript program with confidence.
David Miller
November 23, 2025
1.8k57
Before coding, we need setup.
Step 1: Install Node.js
TypeScript runs on Node.js.
Download from nodejs.org.
Step 2: Install TypeScript compiler
npm install -g typescript
Check:
tsc -v
Step 3: First TypeScript file
Create file: app.ts
let message: string = "Hello TypeScript";
console.log(message);
Step 4: Compile to JavaScript
tsc app.ts
This creates app.js.
Run:
node app.js
tsconfig.json (project setup)
tsc --init
This creates tsconfig.json which controls:
- target JS version
- strict mode
- module system
Graph: build cycle
flowchart LR
A[Write app.ts] --> B[tsc]
B --> C[app.js]
C --> D[node]
Remember
- write .ts
- compile to .js
- run JavaScript
#TypeScript#Beginner#Setup