Skip to content

Instantly share code, notes, and snippets.

@firmread
Forked from isaacs/node-and-npm-in-30-seconds.sh
Last active January 2, 2016 23:29
Show Gist options
  • Save firmread/8377002 to your computer and use it in GitHub Desktop.
Save firmread/8377002 to your computer and use it in GitHub Desktop.
# http://rcrisman.net/article/10/installing-nodejs-on-hostmonster-bluehost-accounts
# 1. Create the directory to store the Node binaries
mkdir -m 755 node
# creates the folder used to store the Node.js binaries
# 2. Download & Compile Node.js
# I like to keep all my Git downloads organized and the following tutorial
# is going to follow my convention on folder structures.
cd downloads/git
git clone http://github.com/joyent/node.git
# You want to use HTTP over GIT as Hostmonster / Bluehost have the Git socket blocked.
# Because Hostmonster / Bluehost are shared server we need to specify
# where to have the Node.js binaries stored
cd node
# Bring us to the Node.js source files
./configure —prefix=/home7/tothongc/node
make && make install
# Replace {username} with your login name for Hostmonster / Bluehost.
# You can find your username in the cPanel on the left where it says username.
# 3. Now we need to make the node command usable so do the following commands
cd
# puts us back at the root of our home folder
nano .bashrc
# 4. Now add the following line to the bottom of the file.
export PATH=/home7/tothongc/node/bin:$PATH
# Replace {username} with your login name for Hostmonster / Bluehost.
# You can find your username in the cPanel on the left where it says username.
# 5. Save
# ctrl+x confirm save by typing ‘Y’ then enter, then enter again to confirm the file.
# 6. Lets verify that everything is working. You will need to reload bash
source .bashrc
# 7. Now verify that node is installed and running
node —version
# Update:
# To Start Node.js can be found here http://www.nodejs.org/
# but for an internet user to access it you will need a dedicated ip address and the port open.
# In most cases it would be something to similar:
node server.js
# this way is best if you want to stay up to date
# or submit patches to node or npm
mkdir ~/.local
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
# could also fork, and then clone your own fork instead of the official one
git clone https://github.com/joyent/node.git
cd node
./configure --prefix=~/.local
make
make install
cd ..
git clone https://github.com/npm/npm.git
cd npm
make
make install # or `make link` for bleeding edge
# reload .bashrc
source .bashrc
# install node wherever.
# use sudo even, it doesn't matter
# we're telling npm to install in a different place.
echo prefix = ~/local >> ~/.npmrc
curl https://npmjs.org/install.sh | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment