Many of them now days want to learn AngularJS 2 but most of them don’t know how to install Typescript Packages, so here i will explain you how to install Typescript and that will be useful to use AngularJS 2 .

Step 1: First thing is we need to download the node JS

https://nodejs.org/en/download/

Download LTS version and install : compare to other version LTS is better .

Step 2: After installation of node js, check the node version by typing the below command

node –version

nodejs

Step 3: After installing node js , even it automatically installs npm(node packet manger), so just check the version of the npm by using below command

npm version

Step 4: If you want to check the latest version of npm or you want to update the version then type the below command

npm -g update

update

Step 5: Installation of typescript:

To install typescript run the below command in cmd .

npm  install  -g  typescript

The -g flag is use for installing typescript globally

globally

Step 6: To check the version of typescript use the below command

tsc -v

typescript version

Step 7: To install Angular CLI

npm install -g @angular/cli

angular js cli

Step 8: To check the version use the below command

angular cli version

This completes the installation of Typescript in Windows 10. To use and check the program whether working fine or no just follow the below instructions

Step 9: To create new project in typescript type the below command

ng new second

second  is the name of the project, it takes few minutes to create project

new project folder-angular js

Step 10 : Now Write program using IDE and save program (Extension of programs for typescript will be always .ts)first project source code

Step 11: Just save the program and run it using the below command

ng serve

ng serve

Step 12 : Go to browser and run the program by typing

http://localhost:4200

Sample first project

This completes the installation and working on typescript.

You can follow the below video for installation

Advertisements