TypeScript Environment Setup
In this lesson, we will learn how to install or set up the TypeScript Environment for Microsoft Windows operating system. Basically, there are two ways to set up the typescript environment, these are:
- You can install TypeScript using
node.js package manager
(npm)
- You can install the
TypeScript plugin
in our IDE (Integrated Development Environment).
Installation of TypeScript using npm (node.js package manager)
Node.js is a JavaScript runtime environment that is used to run server-side applications written in JavaScript or TypeScript, while the NPM is a node package manager which is used to install the packages that are used in the node and web development.
The steps of installing the node and npm are given below:
Step 1: Downloading Node Js
Go to the official site of the node.js or click on the given link: https://nodejs.org/en/ (It will directly take you to the official website of the node.js)
Click on any of the green boxes, to download the node.js automatically to your system.
Step 2: Accepting policies
After downloading it, then we need to install it in our system. Click on the Run button.
Step 3: Selecting Features
Click on "Node.js runtime" and then click on the Next button.
Click on the Next button.
Step 4: Installing node.js
Click on the Install button.
Wait until the installation gets finished, and then click on the Finish button.
Step 5: Checking node.js version
To check the version of the node, open Command Prompt and then write the command node -v
and then press enter.
Step 6: Checking npm version
To check the npm version, write a command npm -v
on the command prompt and then press enter.
So, node and npm server is installed within your local system. Let's move forward and set up a typescript environment.
Step 7: Installing TypeScript Compiler
To install the TypeScript compiler globally, write the command npm install -g typescript
and then press enter.
Step 8: Checking TypeScript compiler version
To check the version of the TypeScript compiler installed in your system, write command tsc -v
and then press enter.
We can check the version of the TypeScript compiler installed in our system using the command tsc -v
and then press enter.
Conclusion
In this lesson, first, we have described step by step process of how to install node.js in the Windows operating system, then we have to set up the typescript environment by installing the typescript compiler in the local system.
We will learn how to install the TypeScript plugin in our IDE (Integrated Development Environment) in the next lesson.