0%
Installing and Configuring TypeScript

Installation

Set up your TypeScript environment

10-15 min

Installing and Configuring TypeScript

In this tutorial, we'll walk through how to install and configure TypeScript so you can start developing efficiently.

Prerequisites

Before you begin, make sure you have:

  • Node.js installed (version 14 or higher)
  • npm or yarn as a package manager
  • A code editor (VS Code recommended)

Check Node.js

node --version
npm --version

Installing TypeScript

1. Global installation (recommended for beginners)

# With npm
npm install -g typescript

# With yarn
yarn global add typescript

2. Verify the installation

tsc --version

You should see something like: Version 5.3.3

Creating Your First TypeScript Project

1. Create a new folder

mkdir mon-projet-typescript
cd mon-projet-typescript

2. Initialize the project

# Initialize npm
npm init -y

# Install TypeScript locally (recommended for projects)
npm install -D typescript

# Install Node.js types (if needed)
npm install -D @types/node

3. Create the configuration file

# Generate tsconfig.json
npx tsc --init

Comments

Comments are powered by GitHub Discussions

Sign in with GitHub to join the discussion

Link copied!