Install nvm – Node Version Manager & node on Mac

Quick tip of the day. How to install nvm (Node Version Manager) & Node?

osMac:
I am going to use Homebrew to install NVM on Mac, follow the steps given below.

  1. brew update
  2. brew install nvm
  3. mkdir ~/.nvm
  4. nano ~/.bash_profile

Once you have run above commands successfully, next you need to modify your .bash_profile or .zshrc (robbyrussell/oh-my-zsh) depends what you are using. Add following two lines at the end the .bash_profile file.

  1. export NVM_DIR=~/.nvm
  2. source $(brew --prefix nvm)/nvm.sh

Save and exit the file to check if nvm is installed and configured correctly.

  1. source .bash_profile
  2. echo $NVM_DIR , if you see the correct nvm path, then all set.

Let’s install node, but before you install node take a look at available node versions in order to get idea how they are named.

  1. nvm ls-remote, go for your desire version or you can alway look for “(Latest LTS: Dubnium)”
  2. nvm install v10.13.0

After this you have successfully install nvm, node & npm, run following commands to verify installed versions.

  1. node -v
  2. npm -v

That’s it, see you in next quick tip.

 

Author: Danyal
I'm skilled programmer with expertise in Vue.js/Nux.js for front-end development and PHP Laravel for back-end development. I excel in building APIs and services, and also have experience in web server setup & maintenance. My versatile skill set allows you to develop and maintain web applications effectively, from the user interface to the server-side functionality. I love coding with never ending learning attitude, thanks for visiting danya.dk