-
-
Save virenratan/04084e17bf3d88ed89093f7704e34351 to your computer and use it in GitHub Desktop.
Installing Node.js with Homebrew and nvm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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