Skip to content

Instantly share code, notes, and snippets.

@sidorares
Created December 15, 2013 02:51
Show Gist options
  • Save sidorares/7968253 to your computer and use it in GitHub Desktop.
Save sidorares/7968253 to your computer and use it in GitHub Desktop.
#!/bin/sh
PREFIX="$HOME/node-latest"
LATEST=$(curl -s http://nodejs.org/dist/latest/ | egrep -o -m1 -e '"node.*?-darwin-x64.tar.gz"' | sed s/\"//g)
mkdir -p "$PREFIX" && \
curl http://nodejs.org/dist/latest/$LATEST \
| tar xzvf - --strip-components=1 -C "$PREFIX"

Starting with node v0.8.6, we're gonna be releasing official binary tarballs of the releases for the most common platform+architecture combos.

Here's a simple script that will install the latest node version for OSX (64bit) using a simple curl | tar piping. By default the files will get installed into your HOME directory. Change the PREFIX variable to /usr/local if you're feeling ambitious (note: you may need to run this as root depending on the PREFIX).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment