
You need to install a number of dependancies before you can install Node.js and NPM.
You’ll also need the terminal to use Node.js and NPM.
You should have some familiarity with the Linux terminal since you’ll need to use it to install and test Node and NPM. It allows you to download and install open source JavaScript libraries that help you make awesome applications. In order to create such applications, you’ll need NPM a package manager for Node. Node.js is non-blocking, which means it’s ideal for creating real-time web applications such as chat servers, analytics, collaboration tools, and interactive games. From its birthplace in the Netscape browser in the mid-nineties, it’s made its way into all modern web browsers, onto mobile phones, and into electronics to make full-fledged web applications on the server-side with Node.js. This answer has the same disadvantages as previously mentioned for compiling from source.JavaScript is used everywhere today. Sudo ln -s /usr/local/bin/node-waf /usr/bin/node-wafįrankly, the situation for node.js on CentOS/RHEL is rather bad, as none of the repos include node.js (see related question here). Sudo ln -s /usr/local/bin/npm /usr/bin/npm Sudo ln -s /usr/local/lib/node /usr/lib/node sudo ln -s /usr/local/bin/node /usr/bin/node Might not be needed depending on your version. Sudo tar xzvf ~/node-v0.8.22-linux-圆4.tar.gz -strip=1Īnd for me on CentOS 6.3, I had to add the following links so that node and npm commands worked from either regular user or from sudo. Latest_node=$(curl | grep 'linux-圆4.tar.gz' | awk '') Here's the script I use: # get the latest stable binary There's one more approach I haven't seen listed in any of the other answers, and that is to use the binary distributions for Linux which have been published since 0.8.6 Then install and check the version: # rpm -ivh nodejs-0.8.18-1.x86_64.rpm
Now make the nodejs package: # fpm -s dir -t rpm -n nodejs -v 0.8.18 -C /tmp/nodejs/ usr/bin usr/lib To create an RPM package, you can use FPM: # wget You can modify the "configure" file to point to python2.7 in line 1 if necessary. Note that this requires Python 2.6+ to use. (cd into extracted folder: ex "cd node-v0.10.3")