Skip to content

Instantly share code, notes, and snippets.

@JamesMGreene
Forked from shapeshifta78/install-nodejs.sh
Last active October 28, 2016 16:44
Show Gist options
  • Save JamesMGreene/b28b187e5f2265af7a4a to your computer and use it in GitHub Desktop.
Save JamesMGreene/b28b187e5f2265af7a4a to your computer and use it in GitHub Desktop.
#!/bin/sh
#version details
VERSION=0.8.8
PLATFORM=linux
ARCH=x86
PREFIX="$HOME/node-v$VERSION-$PLATFORM-$ARCH"
#download binaries
mkdir -p "$PREFIX" && \
curl http://nodejs.org/dist/v$VERSION/node-v$VERSION-$PLATFORM-$ARCH.tar.gz \
| tar xzvf - --strip-components=1 -C "$PREFIX"
#create symlinks
sudo ln -s $HOME/node-v$VERSION-$PLATFORM-$ARCH/bin/node /usr/local/bin/node
sudo ln -s $HOME/node-v$VERSION-$PLATFORM-$ARCH/bin/npm /usr/local/bin/npm

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 node 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