In this section, we will learn how to install TypeScript, pre-requisites before installation of TypeScript, and in how many ways we can install TypeScript.
Pre-requisite to install TypeScript
Ways to install TypeScript
There are two ways to install TypeScript:
Install TypeScript using Node.js Package Manager (npm)
Step-1 Install Node.js. It is used to setup TypeScript on our local computer.
To install Node.js in Windows go to the following link:
To install Node.js in Linux/Ubuntu/CentOS go to the following link:
To verify the installation was successful, enter the command $ node -v in the Terminal Window.
Step-2 Install TypeScript. To install TypeScript enter the following command in the Terminal Window.
Step-3 To verify the installation was successful, enter the command $ tsc -v in the Terminal Window.
Install the TypeScript plug-in in your IDE:
Step-1 Install IDE like Eclipse, Visual Studio, WebStorm, Atom, Sublime Text, etc. Here, we install Eclipse. To install Eclipse go to the following link:
Step-2 Install TypeScript plug-in.
Online Compiler for TypeScript:
We can also run our script online with official compiler. To do this, Go to the following link.