I have a fresh installation of Ubuntu 14.04 and installed compiled version of node.js 10.38.
npm install
failed on node-gyp rebuild
step with error 'make: g++: Command not found'.
apt-get install g++
solves the problem. It make sense put g++ dependency into README.md Prerequisites section.
That's kind of annoying but yea, we might need to do something like that. Compilers are a dependency for any binary npm module (which one of our dependencies depends on). Even contextify itself doesn't call out the need for g**. When you install node / npm via apt
does it not install build-essential
as well? It seems like it should since that's a requirement for many modules.
I used the recommended approach for Debian and Ubuntu based distributions . build-essential
is not a part of installation. But I see your point, contextify setup on Windows even more complicated.
The installation of build-essential is not 'optional'. It is a prerequisite for npm install
otherwise node-gyp will fail.
The instructions for the Debian-based installation should reflect that build-essential is a prerequisite.
for installing g++ in fedora and other linux os use
sudo yum install /usr/bin/g++
or
sudo dnf install gcc-c++
sudo apt-get install build-essential checkinstall
fixed it for me (Ubuntu)
sudo yum install /usr/bin/g++
works for CentOS7, too. :)
Most helpful comment
for installing g++ in fedora and other linux os use
sudo yum install /usr/bin/g++
or
sudo dnf install gcc-c++