Skip to content

Instantly share code, notes, and snippets.

@tralamazza
Created March 15, 2012 11:05
Show Gist options
  • Select an option

  • Save tralamazza/2043678 to your computer and use it in GitHub Desktop.

Select an option

Save tralamazza/2043678 to your computer and use it in GitHub Desktop.
nodejs (debian) installer/bootstrap
#!/bin/sh
# $1 nodejs version, e.g. "0.6.12"
sudo apt-get install -y libssl-dev g++
if [ ! -d "node-v$1" ]; then
# download + extract
curl http://nodejs.org/dist/v$1/node-v$1.tar.gz | tar xzf -
fi
# make install
cd node-v$1 && ./configure && make -j && sudo make install
# clean
rm -rf node-v$1
@tralamazza
Copy link
Author

curl http://npmjs.org/install.sh | sudo sh
sudo npm install n -g

This install npm and n. Subsequent nodejs versions can simply be installed using: sudo n stable

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