How To Install node-gyp on CentOS 7

In this tutorial we learn how to install node-gyp on CentOS 7. node-gyp is Node.js native addon build tool

Introduction

In this tutorial we learn how to install node-gyp on CentOS 7.

What is node-gyp

node-gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js, which takes away the pain of dealing with the various differences in build platforms. It is the replacement to the node-waf program which is removed for node v0.8.

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

Install node-gyp on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install node-gyp

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

sudo dnf -y install node-gyp

How To Uninstall node-gyp on CentOS 7

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

sudo dnf remove node-gyp

References

Summary

In this tutorial we learn how to install node-gyp on CentOS 7 using yum and dnf.