-
-
Save hlobil/5412569 to your computer and use it in GitHub Desktop.
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/sh | |
# Usage: | |
# curl https://raw.github.com/gist/3791075 | sh -s 0.8.10 | |
# This script will simply install/update node.js to the version you specify. | |
# It will be installed/updated to $HOME/local/node | |
NODEJS=v$1 | |
cd /tmp | |
wget http://nodejs.org/dist/$NODEJS/node-$NODEJS.tar.gz | |
tar -xzvf node-$NODEJS.tar.gz | |
cd node-$NODEJS | |
make clean | |
./configure --prefix=$HOME/local/node | |
make | |
make install | |
# install/update npm | |
curl -k https://npmjs.org/install.sh | clean=yes sh | |
# Put the below in your ~/.bash_profile | |
# function update-node { | |
# version=$1 | |
# curl https://raw.github.com/gist/3791075 | sh -s $version | |
# } | |
# Now you can simply run update-node 0.8.10 ! | |
# Oh and btw, it will install node to ~/local/node directory. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment