How To Install node-typescript-types on Ubuntu 20.04

In this tutorial we learn how to install node-typescript-types on Ubuntu 20.04. node-typescript-types is Supposedly high quality TypeScript type definitions

Introduction

In this tutorial we learn how to install node-typescript-types on Ubuntu 20.04.

What is node-typescript-types

node-typescript-types is:

TypeScript type definitions supplied by the DefinitelyTyped project, for JavaScript packages that don’t supply their own type definitions.

This description would be longer, but upstream does not give one on their website nor on their Github page. After some very painful experience using NPM, one can eventually deduce that these definitions are needed for certain typescript packages that build on top of javascript packages, where these latter packages don’t themselves define any typescript types.

This package contains a subset of the upstream type definitions because there are a ridiculous amount (a few hundred megabytes) and the vast majority of them are probably never going to be needed for Debian. Currently these are:

@types/backbone                         1.4.1
@types/chai                             4.2.9
@types/estree                           0.0.42
@types/expect.js                        0.3.29
@types/fs-extra                         8.1.0
@types/glob                             7.1.1
@types/handlebars                       4.1.0
@types/highlight.js                     9.12.3
@types/jest                             25.1.2
@types/jquery                           3.3.32
@types/jsdom                            16.1.0
@types/lodash                           4.14.149
@types/marked                           0.7.2
@types/mathjax                          0.0.36
@types/micromatch                       4.0.1
@types/minimatch                        3.0.3
@types/minimist                         1.2.0
@types/mocha                            7.0.1
@types/node                             13.7.2
@types/requirejs                        2.1.31
@types/sax                              1.2.1
@types/semver                           7.1.0
@types/shelljs                          0.8.6
@types/sinon                            7.5.1
@types/sizzle                           2.3.2
@types/underscore                       1.9.4

If you need more than these, please file a bug report asking for git access so that you can update this package yourself.

There are three methods to install node-typescript-types on Ubuntu 20.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install node-typescript-types Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install node-typescript-types using apt-get by running the following command:

sudo apt-get -y install node-typescript-types

Install node-typescript-types Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install node-typescript-types using apt by running the following command:

sudo apt -y install node-typescript-types

Install node-typescript-types Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install node-typescript-types using aptitude by running the following command:

sudo aptitude -y install node-typescript-types

How To Uninstall node-typescript-types on Ubuntu 20.04

To uninstall only the node-typescript-types package we can use the following command:

sudo apt-get remove node-typescript-types

Uninstall node-typescript-types And Its Dependencies

To uninstall node-typescript-types and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:

sudo apt-get -y autoremove node-typescript-types

Remove node-typescript-types Configurations and Data

To remove node-typescript-types configuration and data from Ubuntu 20.04 we can use the following command:

sudo apt-get -y purge node-typescript-types

Remove node-typescript-types configuration, data, and all of its dependencies

We can use the following command to remove node-typescript-types configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge node-typescript-types

References

Summary

In this tutorial we learn how to install node-typescript-types package on Ubuntu 20.04 using different package management tools: apt, apt-get and aptitude.