Skip to content

Instantly share code, notes, and snippets.

@imlucas
Last active August 29, 2015 14:09
Show Gist options
  • Save imlucas/c5e4e327feb2ee539034 to your computer and use it in GitHub Desktop.
Save imlucas/c5e4e327feb2ee539034 to your computer and use it in GitHub Desktop.
How to install node.js...

How to install node.js

OSX

Click the "Install" button to download the installer

Windows

Click the "Install" button to download the installer

Ubuntu

curl -sL https://gist.githubusercontent.com/imlucas/c5e4e327feb2ee539034/raw/cfccdc72f078171399f43b2ee94767028b0e48ed/ubuntu.sh | sudo bash -

RHEL

# Must be run as root
curl -sL https://gist.githubusercontent.com/imlucas/c5e4e327feb2ee539034/raw/cfccdc72f078171399f43b2ee94767028b0e48ed/rhel.sh | bash -

Debian

# Must be run as root
curl -sL https://gist.githubusercontent.com/imlucas/c5e4e327feb2ee539034/raw/cfccdc72f078171399f43b2ee94767028b0e48ed/ubuntu.sh | bash -

Todo

Other recipes to cover

Can't use sudo

Sketch:

# wget/curl binary tarball from nodejs.org
# unpack/"install" somewhere easy like ~/.nodejs
# scaffold directories like ~/.nodejs/node_modules and friends
# create npm config to point at ~/.nodejs
# print $PATH changes to copy into .bashrc/.profile or just append to them

Can't use sudo and need to use a proxy

Sketch:

# preamble to easily specify your corp outgoing PROXY host
# contents of "Can't use sudo"
# Must be run as root.
#
# See the node.js wiki for more details:
# http://git.io/h8Mf
curl -sL https://deb.nodesource.com/setup | bash -
apt-get install -y nodejs build-essential
# Must be run as root.
# See the node.js wiki for more details:
# http://git.io/h8Hu
curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs gcc-c++ make
# See the node.js wiki for more details:
# http://git.io/h8Mf
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs build-essential
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment