Skip to content

Instantly share code, notes, and snippets.

@ryanrolds
Created December 9, 2011 00:52
Show Gist options
  • Save ryanrolds/1449558 to your computer and use it in GitHub Desktop.
Save ryanrolds/1449558 to your computer and use it in GitHub Desktop.
Local node installer
#!/bin/bash
NODEVERSION=$1
mkdir ~/local
mkdir ~/node-v$NODEVERSION-install
cd ~/node-v$NODEVERSION-install
curl http://nodejs.org/dist/v$NODEVERSION/node-v$NODEVERSION.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local/node-v$NODEVERSION
make install
rm -f ~/local/node
ln -s ~/local/node-v$NODEVERSION ~/local/node
# Should only be done once
if [ `grep 'export PATH=*\$HOME\/local\/node\/bin*' ~/.bashrc >/dev/null 2>&1; echo $?` -eq "1" ]; then
echo 'export PATH=$HOME/local/node/bin:$PATH' >> $HOME/.bashrc
echo '';
echo '';
echo 'RUN THIS COMMAND TO UPDATE SEARCH PATH!!!'
echo '';
echo '. ~/.bashrc';
echo '';
echo '';
fi
wget https://raw.github.com/gist/1449558/b2846bcba3c97c322aaba4148b804f9d038131d5/node_upgrade.sh
chmod +x node_upgrade.sh
./node_upgrade.sh <version>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment