Open your terminal & type
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
Close your terminal & reopen a new one & type
nvm ls
You will see something like
system
iojs -> N/A (default)
node -> stable (-> N/A) (default)
unstable -> N/A (default)
nvm_list_aliases:36: no matches found: /Users/adeelimran/.nvm/alias/lts/*
Next in your terminal type
nvm install 12.16.1
Once it is installed, we can start using it
nvm use 12.16.1
Now that it is installed let's check it by doing
node --version // will output v12.16.1
Uninstall NVM
rm -rf $NVM_DIR ~/.npm ~/.bower
Nvm can be used to manager various node version:
- Step1: Download nvm https://github.com/coreybutler/nvm-windows/releases
- Step2: Choose nvm-setup.zip
- Step3: Unzip & click on installer.
- Step4: Check if nvm properly installed, In new command prompt type nvm
- Step5: Install node js using nvm : nvm install : The version can be a node.js version or "latest" for the - latest stable version
- Step6: check node version - npm -v
- Step7: If you want to install another version of node js - Use STEP 5 with different version.
- Step8: Check list node js version - nvm list
- Step9: If you want to use specific node version do - nvm use