Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Script to install update node.js
#!/bin/sh
# Usage:
# curl https://gist.githubusercontent.com/madhums/3791075/raw/38675884dfb7e3acd5672092807da54509748266/nodejs-install-update.sh | 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=$1
cd /tmp
wget http://nodejs.org/dist/v$NODEJS/node-v$NODEJS.tar.gz
tar -xzvf node-v$NODEJS.tar.gz
cd node-v$NODEJS
make clean
./configure --prefix=$HOME/local/node
make
make install
# install/update npm
curl -kL https://npmjs.org/install.sh | clean=yes npm_config_prefix=$HOME/local/node sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment