Featured image of post Resolving the Error 'make: g++: Command not found' during npm install

Resolving the Error 'make: g++: Command not found' during npm install

Issue: Encountering 'make: g++: Command not found' when running the npm install command...

Issue

When you encounter the error message make: g++: Command not found while running the npm install command, it typically indicates that you are missing a necessary C++ compiler.

Resolving the error ‘make: g++: Command not found’ during npm install

Solution

To resolve this issue, you need to install a C++ compiler. On Linux systems, you can install the C++ compiler using the following commands:

  1. For Debian/Ubuntu systems:
1
sudo apt-get install g++  
  1. For CentOS/Fedora/RHEL systems:
1
sudo yum install gcc-c++  

If your system is not one of the above distributions, please refer to your system’s documentation on how to install a C++ compiler.

Once the installation is complete, you can run the npm install command again. If you are using a Windows operating system, you may need to install Visual C++ Build Tools before installing the C++ compiler.

After that, you can proceed with the solution.

Licensed under CC BY-NC-SA 4.0