How to Install Multiple Versions of Node.js and Manage it Using NVM Node Version Manager node package manager (NPM)

Go to 
download and install the latest

Mac or Unix
1. #Install command line developer tools. 
$ xcode-select --install

2. Install the latest version of NVM 

-- Clone NVM 
$ cd ~/ 
$ git clone .nvm 

-- Checkout latest version of nvm 
$ cd ~/.nvm 
$ git checkout v0.34.0

-- Activate NVM 
$ . 

-- Now add these lines to your ~/.bashrc, ~/.profile, 
or ~/.zshrc file to have it automatically sourced upon 

export NVM_DIR="$HOME/.nvm" 
source ~/.nvm/
[ -s "$NVM_DIR/" ] && \. "$NVM_DIR/"  
# This loads nvm 
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  
# This loads nvm bash_completion 

3. List your installed node versions: 
$ nvm list 

4. List the available node versions in the cloud: 
$ nvm ls-remote 
$ nvm ls-remote | tail -n9 
$ nvm ls-remote --lts

5. Install node of version 10.16.0 
$ nvm install 10.16.0 
$ nvm use 10.16.0 
$ nvm alias default1 10.16.0 
$ nvm list 
$ nvm unalias default1
$ nvm install v9.0.0 --reinstall-packages-from=8.9

6. Uninstall
cd ~/.nvm/versions/node 
sudo rm -rf v4.2.3/
//Try clearing cash nvm cache clear 

7. List the installable node versions with nvm
nvm ls-remote

8. List the local node versions with nvm
nvm ls

This entry was posted in Technologies. Bookmark the permalink.