Find us on facebook

May 31, 2015

Install Node.js on Ubuntu AND Linux

Ubuntu

sudo apt-get update

Then use apt-get to install Node.js build dependencies:
sudo apt-get install -y build-essential openssl libssl-dev pkg-config

Move to /usr/src directory - the usual place to hold software sources.
cd /usr/src

pick the latest compressed source archive from Node.js website at http://nodejs.org/download/.
sudo wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz

Uncompress the source files and move into that directory.
sudo tar zxf node-v0.12.4.tar.gz
cd node-v0.12.4

Prepare compiler commands, by executing the configure script:
sudo ./configure

It will read the properties of the system to prepare compiler flags. Ie. it could be a system architecture (32/64bit, CPU specific flags etc). With it, Now ready to actually compile the source now. To do that, just type:
sudo make

To make this available system-wide:
sudo make install

Linux

Update software repository to the latest versions:
sudo yum -y update

Install "Development Tools". It's a group of tools for compiling software from sources.
sudo yum -y groupinstall "Development Tools"

Move to /usr/src directory - the usual place to hold software sources.
cd /usr/src

pick the latest compressed source archive from Node.js website at http://nodejs.org/download/.
sudo wget http://nodejs.org/dist/v0.12.4/node-v0.12.4.tar.gz

Uncompress the source files and move into that directory.
sudo tar zxf node-v0.12.4.tar.gz
cd node-v0.12.4

Prepare compiler commands, by executing the configure script:
sudo ./configure

It will read the properties of the system to prepare compiler flags. Ie. it could be a system architecture (32/64bit, CPU specific flags etc). With it, Now ready to actually compile the source now. To do that, just type:
sudo make

To make this available system-wide:
sudo make install

No comments:

Post a Comment