Skip to content

Instantly share code, notes, and snippets.

@madhums
Last active October 1, 2017 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save madhums/3791075 to your computer and use it in GitHub Desktop.
Save madhums/3791075 to your computer and use it in GitHub Desktop.
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