Skip to content

Instantly share code, notes, and snippets.

@franklinjavier
Created October 16, 2015 01:17
Show Gist options
  • Save franklinjavier/bdc2e1f12db42e285dfb to your computer and use it in GitHub Desktop.
Save franklinjavier/bdc2e1f12db42e285dfb to your computer and use it in GitHub Desktop.
Install nvm, node stable and npm
#!/usr/bin/env bash
set -e
echo "Installing nvm..."
[ -d ~/.nvm ] && rm -rf ~/.nvm
git clone https://github.com/creationix/nvm.git ~/.nvm
cd ~/.nvm
git checkout `git describe --abbrev=0 --tags`
cd - >/dev/null
echo "...done" || echo "...failed" >&2
echo "Sourcing nvm..."
source ~/.nvm/nvm.sh
echo "...done" || echo "...failed" >&2
echo "Installing node stable..."
nvm install stable
nvm alias default stable
echo "...done" || echo "...failed" >&2
echo "Installing npm..."
npm install -g npm
echo "...done" || echo "...failed" >&2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment