TypeScript Installation

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

  1. Text Editor or IDE
  2. Node.js Package Manager (npm)
  3. The TypeScript compiler

Ways to install TypeScript

There are two ways to install TypeScript:

  1. Install TypeScript using Node.js Package Manager (npm).
  2. Install the TypeScript plug-in in your IDE (Integrated Development Environment).

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 on Windows, go to the following link: https://www.rookienerd.com/install-nodejs

To install Node.js in Linux/Ubuntu/CentOS, go to the following link: https://www.rookienerd.com/install-nodejs-on-linux-ubuntu-centos

To verify the installation was successful, enter the following command in the Terminal Window.

snippet
$ node -v
$ npm -v
TypeScript Installation

Step-2 Install TypeScript. To install TypeScript, enter the following command in the Terminal Window.

snippet
$ npm install typescript --save-dev         //As dev dependency
$ npm install typescript -g                      //Install as a global module
$ npm install typescript@latest -g          //Install latest if you have an older version

Step-3 To verify the installation was successful, enter the command $ tsc -v in the Terminal Window.

TypeScript Installation

Install 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:

In Windows: https://www.rookienerd.com/javafx-how-to-install-eclipse

In Ubantu: https://www.rookienerd.com/how-to-install-eclipse-in-ubuntu

In CentOS: https://www.rookienerd.com/how-to-install-eclipse-on-centos

Step-2 Install TypeScript plug-in.

  • Open Eclipse and go to Help->Eclipse Market Place.
  • Search for TypeScript and choose TypeScript IDE, Click Install.
TypeScript Installation
  • In the next window, select Features which you want to install, and click Confirm.
  • A new window will open, select Accept Terms and Condition, Click Next, and follow the on-screen instructions.
  • Now restart Eclipse. To verify the TypeScript, go to New->Other->TypeScript. Once the TypeScript shows in the window, it means that TypeScript is successfully installed on your machine.
TypeScript Installation

Online Compiler for TypeScript

We can also run our script online with the official compiler. To do this, go to the below link. https://www.typescriptlang.org/play/index.html

TypeScript Installation
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #
Contents +