How To Install node-pegjs on Ubuntu 20.04

In this tutorial we learn how to install node-pegjs on Ubuntu 20.04. node-pegjs is JavaScript parser generator JavaScript parser generator

Introduction

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

What is node-pegjs

node-pegjs is:

PEG.js is a simple parser generator for JavaScript that produces fast parsers with excellent error reporting. You can use it to process complex data or computer languages and build transformers, interpreters, compilers and other tools easily.

Package: node-pegjs Architecture: all Version: 0.10.0-1 Priority: optional Section: universe/web Source: pegjs Origin: Ubuntu Maintainer: Ubuntu Developers [email protected] Original-Maintainer: Debian Javascript Maintainers [email protected] Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 756 Provides: libjs-pegjs, node-peg, nodejs, pegjs Filename: pool/universe/p/pegjs/node-pegjs_0.10.0-1_all.deb Size: 70432 MD5sum: acd2d68a02fcb1270d64a86871a9420e SHA1: 886d2f711e0d6862531b10109b2fb94e0acee921 SHA256: 6c03d83c9cf673ce59b0883d890b5e100c921c897b5f42654177d318ca6a8913 Homepage: https://github.com/dmajda/pegjs Description-en: JavaScript parser generator PEG.js is a simple parser generator for JavaScript that produces fast parsers with excellent error reporting. You can use it to process complex data or computer languages and build transformers, interpreters, compilers and other tools easily.

There are three methods to install node-pegjs 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-pegjs 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-pegjs using apt-get by running the following command:

sudo apt-get -y install node-pegjs

Install node-pegjs Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install node-pegjs

Install node-pegjs 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-pegjs using aptitude by running the following command:

sudo aptitude -y install node-pegjs

How To Uninstall node-pegjs on Ubuntu 20.04

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

sudo apt-get remove node-pegjs

Uninstall node-pegjs And Its Dependencies

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

sudo apt-get -y autoremove node-pegjs

Remove node-pegjs Configurations and Data

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

sudo apt-get -y purge node-pegjs

Remove node-pegjs configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge node-pegjs

References

Summary

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