node-gyp command not found

In this troubleshooting guide we learn how to fix node-gyp command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

node-gyp: command not found

or when using sudo you get the following error message

sudo: node-gyp: command not found

Solutions to node-gyp: command not found

How To Fix node-gyp: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu node-gyp is provided by node-gyp package.

node-gyp is:

node-gyp is a cross-platform command-line tool written in Node.js for compiling native addon modules for Node.js.

It features :

  • Easy to use, consistent interface
  • Same commands to build a module on every platform
  • Support of multiple target versions of Node.js

Node.js is an event-based server-side javascript engine.

To fix this problem, we can install more using the command below.

sudo apt-get -y install node-gyp

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install node-gyp.

sudo apt -y install node-gyp

Or if you have aptitude installed you can use the following command.

sudo aptitude install node-gyp

Summary

In this tutorial we learn how to fix node-gyp command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.