Reason to use; nvm mainly used in Mac/linux environment, but not in windows, and nvm-windows just do exactly this (for windows)
Some of the project requires later Node version, while some only worked with older version. That's why we need a node version switcher to toggle between the 2. Here's how to configure it.
- Uninstall existing Node.js from windows
- Delete any existing Node.js directories (e.g., "C:\Program Files\nodejs)
- Delete the existing npm install location (e.g. "C:\Users\<user>\AppData\Roaming\npm") to avoid global module conflicts.
- Backup any global npmrc config (e.g. C:\Users\<user>\AppData\Roaming\npm\etc\npmrc), or copy the settings to the user config C:\Users\<user>\.npmrc.
- Download latest nvm-windows installer here https://github.com/coreybutler/nvm-windows/releases
- install the nvm-windows installer
- Open shell and run 'nvm install 12' to install Node 12.0
- And runs 'nvm install 8.15' to install Node 8.15
- check npm command whether its works, else need to uninstall and reinstall node version for compatible environment.
- Run nvm use 12 or nvm use 8.15 to switch between the project.
- Run npm i or npm install to ensure dependencies of each Node v is correct
- If you plan to use yarn, run npm i -g yarn for a start.
- Follow by npm or yarn command for development commands.
- To update project; repeat step 10.
Head on here to for nvm-windows README.md here https://github.com/coreybutler/nvm-windows/blob/master/README.md