Skip to content

Instantly share code, notes, and snippets.

@nicoayala
Forked from dwayne/00-install-on-64-bit-ubuntu-14.04.md
Last active October 25, 2016 17:34
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicoayala/5425809 to your computer and use it in GitHub Desktop.
Save nicoayala/5425809 to your computer and use it in GitHub Desktop.
# The install script
# Adapted from https://gist.github.com/579814
install_path=local
download_path=Downloads/node-latest-install
echo '# Added by install script for node.js and npm in 30s' >> ~/.bashrc
echo 'export PATH=$HOME/'$install_path'/bin:$PATH' >> ~/.bashrc
echo 'export NODE_PATH=$HOME/'$install_path'/lib/node_modules' >> ~/.bashrc
. ~/.bashrc
mkdir -p ~/$install_path
mkdir -p ~/$download_path
cd ~/$download_path
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/$install_path # if SSL support is not required, use --without-ssl
make install # ok, fine, this step probably takes more than 30 seconds...

Assumes a fresh install of Ubuntu 12.04 LTS.

  1. Setup the system to handle compiling and installing from source.

     $ sudo apt-get install build-essential
    
  2. If SSL support is needed then we will need to install libssl-dev.

     $ sudo apt-get install libssl-dev
    
  3. The install script uses curl, so we will need to install curl.

     $ sudo apt-get install curl
    
  4. Change into the directory containing the install script and source it.

     $ . node-and-npm-in-30s.sh
    

    N.B. This step takes a while.

  5. Finally, check that the latest version of node and npm are indeed installed.

     $ node -v
     $ npm -v
    

References:

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