Last active
October 1, 2017 10:25
-
-
Save madhums/3791075 to your computer and use it in GitHub Desktop.
Script to install update node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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