Skip to content

Instantly share code, notes, and snippets.

@riguelbf
Forked from mshick/install.sh
Created June 22, 2018 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riguelbf/4abe192dd4db85237b37895a59ea5cde to your computer and use it in GitHub Desktop.
Save riguelbf/4abe192dd4db85237b37895a59ea5cde to your computer and use it in GitHub Desktop.
Installing Node.js with Homebrew and nvm
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install nvm
brew install nvm
# Export nvm environment
export NVM_DIR="$HOME/.nvm"
. "$(brew --prefix nvm)/nvm.sh"
# Install latest Node.js
nvm install stable && nvm use stable
# Save your nvm env loading into your .bash_profile or similar
if [[ $(brew ls --versions nvm) ]]
then
export NVM_DIR="$HOME/.nvm"
. "$(brew --prefix nvm)/nvm.sh"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment