How To Install nodejs-dep-graph on CentOS 7

In this tutorial we learn how to install nodejs-dep-graph on CentOS 7. nodejs-dep-graph is Simple dependency graph management in JavaScript

Introduction

In this tutorial we learn how to install nodejs-dep-graph on CentOS 7.

What is nodejs-dep-graph

This is a Node.js module for simple dependency graph management in JavaScript. Say you have a set of resources that depend on each other in some way. These resources can be anything (eg, files, chains of command etc.). All that matters is that each one has a unique string identifier, and a list of direct dependencies. dep-graph makes it easy to compute “chains” of dependencies, with guaranteed logical ordering and no duplicates. That’s trivial in most cases, but if A depends on B and B depends on A, a naïve dependency graph would get trapped in an infinite loop. dep-graph throws an error if any such “cycles” are detected.

We can use yum or dnf to install nodejs-dep-graph on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install nodejs-dep-graph.

Install nodejs-dep-graph on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install nodejs-dep-graph using yum by running the following command:

sudo yum -y install nodejs-dep-graph

Install nodejs-dep-graph on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install nodejs-dep-graph using dnf by running the following command:

sudo dnf -y install nodejs-dep-graph

How To Uninstall nodejs-dep-graph on CentOS 7

To uninstall only the nodejs-dep-graph package we can use the following command:

sudo dnf remove nodejs-dep-graph

References

Summary

In this tutorial we learn how to install nodejs-dep-graph on CentOS 7 using yum and dnf.