For new accounts please follow these instructions :
The legacy instructions below will work for older shared hosting accounts.
How To Install Node.js On Your Shared Account
Today we’re going to install node.js on your shared account, whether it would be on a PersonalClass or BusinessClass account, through SSH (which is the only way you can install it).
First off, you need your SSH credentials, and access to your account. You can find the credentials in your hosting account setup email you received when you first signed up for the account. If SSH is not already enabled on your account, please request our support team to enable it via live chat, phone, or by emailing support@arvixe.com .
Let’s get started with the tutorial:
1) First off, SSH into your account. You can do this using a number of third party applications. I recommend using either xshell or putty.
2) Browse to your home directory by running the command below, replacing YOURUSERNAME with your hosting account user name:
cd /home/YOURUSERNAME
3) Next, run this command, and make sure it reports something like:
bzip2-devel-1.0.3-6.el5_5
bzip2-devel-1.0.3-6.el5_5
rpm -qa | grep bzip2-devel
4) Next, we are going to install Python 2.7.6 . This is required for node.js . First, we will run this command to download the package:
wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tgz
– Then extract the package running:
tar xzf Python-2.7.6.tgz
-Now we will browse to that folder, similar to step 1, by running:
cd Python-2.7.6
-And now we will configure the make file to prepare it for the installation:
./configure --prefix=$HOME --with-threads --enable-shared
– After you let that complete, run the make file by simply typing:
make
– Once that is done, run the install:
make install
– You then went to get out of that folder, so run:
cd ..
– Then run this so python can recognize the path:
export PATH=~/bin:$PATH
– Next, you want to edit the .bashrc file, located in /home/username . You can do this through an SSH text editor, or simply through file manager in your cPanel account. You need to add these two lines at the end of the file:
export PATH=~/bin:$PATH
export LD_LIBRARY_PATH=~/lib:$LD_LIBRARY_PATH
Save the file and run:
source ~/.bashrc
Finally Getting To Install Node.js
Now that we got Python 2.7.6 running on your account, you can finally go through the node.js install. It’s similar to python, but with less steps. Let’s start.
1) Download the package:
wget http://nodejs.org/dist/v0.10.1/node-v0.10.1.tar.gz
– Extract it:
tar xzf node-v0.10.1.tar.gz
-Browse to the new node.js folder:
cd node-v0.10.1
-Configuring the make file:
./configure --prefix=$HOME
NOTE: THE NEXT TWO COMMANDS BELOW WILL TAKE A WHILE.
-Running the make file to prepare the installation:
make
– And now running the installation
make install
2) Once all that is done, verify that node.js has been installed by running:
node -v
This should return: v 0.10.1 . This means you have successfully installed node.js! If you do not see it, please contact our support team for help.
Looking for quality web hosting? Look no further than Arvixe Web Hosting!
Thanks so much for this guide.
I just wanted to add some instructions on how to upgrade node.js to the current stable version:
npm cache clean -f
npm install -g n
Use the current stable version:
n stable
Or specify the desired version (0.10.21 for example):
n 0.10.21
Verify node version:
node -v
Hi Chris,
Thank you for the information. Unfortunately that is not available on our shared plans but can be used on our VPS and Dedicated Servers.
Regards.
Found something cool to update the current version of node without sudo’ing :
mkdir ~/.nave
cd ~/.nave
wget http://github.com/isaacs/nave/raw/master/nave.sh
chmod 755 ./nave.sh
./nave.sh use stable
node -v
# Should return: v0.12.4
Source: https://gist.github.com/isaacs/579814#file-use-nave-sh
Great!
Good tutorial, followed the steps, now I have node.js my hosting
thank you
I installed node complete on my hosting site. node -v is v0.10.33
I am noticing a problem with running the program though?
Locally: node server.js runs the program
But for the hosting site I can’t run it without error:
js-bson: Failed to load c++ bson extension, using pure JS version
The magic happens on port 8080
events.js:72
throw er; // Unhandled ‘error’ event
^
Error: listen EADDRINUSE
at errnoException (net.js:904:11)
at Server._listen2 (net.js:1042:14)
at listen (net.js:1064:10)
at Server.listen (net.js:1138:5)
at Function.app.listen (/home/user0001/public_html/node_modules/express/lib/application.js:531:24)
at Object. (/home/user0001/public_html/server.js:42:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
Hi,
Please e-mail support@arvixe.com in regards to your issue and include your Arvixe account name. They will need to review your account.
Regards,
Could you provide sample code on how to make a “Hello, world” application? I’d like one of my directories of my website to be a node.js application.
Hi, we have an example here: http://blog.arvixe.com/iis-node-on-arvixe-windows-server-with-socket-io-tutorial/
WARNING: node.js cannot be installed on your shared account using these steps. This document needs updating. I get an error at this step: rpm -qa | grep bzip2-devel. Support said I could skip this step, so I did.
I am now getting an error at this step and support has not gotten back to me:
./configure –prefix=$HOME –with-threads –enable-shared
Hello,
Can you please reply or email alexali@arvixe.com with your ticket ID?
Thanks,
Alex.