There are two ways to install typescript:
- Using npm (Node Package Manager)
- Install the TypeScript plugin in your IDE
✅ Install typescript using npm
You must have node.js installed on your machine. If you don’t have it installed, you can install it from here.
Now, to install typescript just head over to the command prompt and type the following command:
> npm install -g typescript
-g stands for the global level. We are installing typescript at the global level on our machine.
You can check the version of TypeScript and verify if it is installed on your machine with the help of the command below:
> tsc -v
✅ Install the TypeScript plugin in your IDE
You can also install a typescript plugin available for your IDE. You can use IDE of your choices such as VS Code, Visual Studio, Atom, or Sublime Text.
Sharing the links for plugins for the above-mentioned code editors:
For most of the IDEs, you can install typescript by opening up the package manager and then search for ‘typescript’ and install it boom!! 💣
You can download typescript from the official site:
Suppose you want to try out some TypeScript code without having to worry about installing it on your system. You may use the online playground for that.