Skip to content

Instantly share code, notes, and snippets.

@frosas
Created January 7, 2014 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frosas/8297173 to your computer and use it in GitHub Desktop.
Save frosas/8297173 to your computer and use it in GitHub Desktop.
Use static node/npm if system one is not new enough (WIP)
# Make sure we have an up to date node/npm
NODE_VERSION="v0.10.22"
if [[ $(echo -e "$NODE_VERSION\n$(node -v)" | sort -n | tail -n1) == $NODE_VERSION ]]; then
    NODE_DIR=node-$NODE_VERSION-linux-x86
    wget -q http://nodejs.org/dist/$NODE_VERSION/$NODE_DIR.tar.gz -O - | tar xzf -
    export PATH=$(cd ./$NODE_DIR/bin && pwd):$PATH
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment