Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile/install node.js(could not configure a cxx compiler!) (Ubuntu).

How can I compile/install node.js on Ubuntu? It failed with an error about cxx compiler.

like image 577
Alfred Avatar asked Jul 25 '10 13:07

Alfred


3 Answers

One-liner to install all needed dependencies(curl and git are not really needed, but are very useful and also needed if you install via nvm).

sudo apt-get install build-essential libssl-dev curl git-core

Last two dependencies are not always needed, but installing them is really usefull anyway and you probably need it later anyway.

To only install cxx compiler

sudo apt-get install build-essential

If openssl is missing

sudo apt-get install libssl-dev
like image 168
Alfred Avatar answered Nov 16 '22 00:11

Alfred


If like me, you are attempting to install this on an AWS instance running Amazon Linux AMI (which looks to be a cut down version CentOS):

Install base tools:

yum groupinstall "Development Tools"

Now install openssl-devel:

yum install openssl-devel

Node should compile fine now.

like image 25
Jay Sidri Avatar answered Nov 16 '22 01:11

Jay Sidri


If you're attempting this on Win7 like me, running:

ash.exe
$ /bin/rebaseall

...did the trick.

Good luck!

like image 8
Nicholas Blumhardt Avatar answered Nov 16 '22 01:11

Nicholas Blumhardt