Created
December 9, 2011 00:52
-
-
Save ryanrolds/1449558 to your computer and use it in GitHub Desktop.
Local node installer
This file contains hidden or 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 | |
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 |
This file contains hidden or 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
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