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

Windows
Go to  https://github.com/coreybutler/nvm-windows/releases 
download and install the latest nvm-setup.zip
VIDEO:  https://www.youtube.com/watch?v=ZQZ47n9llOQ

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

2. Install the latest version of NVM 
https://github.com/creationix/nvm#git... 

-- Clone NVM 
$ cd ~/ 
$ git clone https://github.com/creationix/nvm.git .nvm 

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

-- Activate NVM 
$ . nvm.sh 

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

export NVM_DIR="$HOME/.nvm" 
source ~/.nvm/nvm.sh
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  
# 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

References 
https://github.com/nvm-sh/nvm
https://github.com/tj/n
https://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/
https://docs.npmjs.com/misc/removing-npm

This entry was posted in Technologies. Bookmark the permalink.