Skip to content

Instantly share code, notes, and snippets.

@constantology
Created October 14, 2012 10:49
Show Gist options
  • Save constantology/3888238 to your computer and use it in GitHub Desktop.
Save constantology/3888238 to your computer and use it in GitHub Desktop.
shell script to update node to a specific version
#!/bin/sh
# add these two variables to your: ~/.bash_profile or ~/.bashrc or just hardcode the directories in place of the variables below
# export NODE_REPO=/usr/local/Library/node/repo
# export NODE_JS=/usr/local/Library/node/js
# example of upgrading to version 0.8.12
# $ sh node.update.sh v0.8.12
cd $NODE_REPO;
git pull;
git checkout $1;
./configure --prefix=$NODE_JS;
make;
make install;
node -v;
npm -v;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment