Skip to content

Instantly share code, notes, and snippets.

@petertoi
Last active April 18, 2020 00:53
Show Gist options
  • Save petertoi/281fa6d550ef29a37b3e to your computer and use it in GitHub Desktop.
Save petertoi/281fa6d550ef29a37b3e to your computer and use it in GitHub Desktop.
Install Node.js on Dreamhost shared hosting
#!/bin/sh
NODEVERSION=v0.12.2
SRCPATH=$HOME/src/node
LOCALPATH=$HOME/usr/local
BINPATH=$LOCALPATH/bin
mkdir -p $SRCPATH
mkdir -p $LOCALPATH
git clone https://github.com/joyent/node.git $SRCPATH
cd $SRCPATH
git checkout $NODEVERSION
./configure --prefix=$LOCALPATH
make $SRCPATH
make install
if [[ ":$PATH:" != *":$BINPATH:"* ]]; then
echo "PATH=$BINPATH:\$PATH" >> ~/.bash_profile
source ~/.bash_profile
fi
node --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment