How to install Typescript on Ubuntu 22.04

Endrit Qerreti

Endrit Qerreti

Typescript is a npm package, and it can be installed on Ubuntu 22.04 easily by using npm.

Typescript is an open source programming language created by Microsoft.

Typescript is useful, and it allows you to make your javascript code better, if you are a javascript developer, and want to learn more what you can do with javascript, then you should definitely give Typescript a try.

In this tutorial, you will learn how to install Typescript on Ubuntu 22.04.

Step 1 - Install Nodejs

Typescript is available on npm registry, which means to be able to install Typescript on your machine, first you must install nodejs.

To install Nodejs on your Ubuntu 22.04 machine, run the command below

sudo apt install nodejs npm

Step 2 - Install Typescript

Now that nodejs, and npm are both installed on your machine, proceed to install Typescript via the command below

npm install -g typescript

Step 3 - Run Typescript

Once you have installed all three packages on your system, you should be able to use Typescript now. However, before using Typescript, you need to check if Typescript installation was done correctly, one way of checking if Typescript can be executed is by checking Typescript version

To check Typescript version, run the following

tsc --version

Conclusion

In this tutorial, you learned how to install Typescript on Ubuntu 22.04, using the npm package typescript.