Installation on UNIX/Linux/Mac OS X, and SunOS
Based on your OS architecture, download and extract the archive node-v4.2.1-
osname.tar.gz into /tmp, and then finally move extracted files into /usr/local/nodejs directory. For example:
$ cd /tmp
$ wget http://nodejs.org/dist/v4.2.1/node-v4.2.1-linux-x64.tar.gz
$ tar xvfz node-v4.2.1-linux-x64.tar.gz
$ mkdir -p /usr/local/nodejs
$ mv node-v4.2.1-linux-x64/* /usr/local/nodejs
Add /usr/local/nodejs/bin to the PATH environment variable.
Local Environment Setup
User The Command: $ sudo gedit ~/.bashrc and Add the path (export PATH=$PATH:/usr/local/nodejs/bin) in this file and save and exit.