Created
July 18, 2012 15:57
-
-
Save outbounder/3137115 to your computer and use it in GitHub Desktop.
install node.js on ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NODE=$1 | |
NVMDIR=$2 | |
NVM=$NVMDIR/nvm.sh | |
echo "installing node.js $1" | |
hash nvm 2>&- || { | |
echo "couldn't find nvm, checking for $NVM" | |
test -e $NVM || { | |
echo "couldn't find $NVM -> installing via git..." | |
hash git 2>&- || { | |
echo "couldn't find git -> installing git..." | |
sudo apt-get -y install git-core || exit 1 | |
} | |
git clone git://github.com/creationix/nvm.git $NVMDIR || exit 1 | |
} | |
. $NVM | |
} | |
test -e $NVMDIR/$NODE || { | |
echo "cound't find $NVMDIR/$NODE -> installing..." | |
sudo apt-get -y install g++ curl libssl-dev apache2-utils || exit 1 | |
nvm install $NODE || exit 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment