# Use multiple node versions on a machine

> TL;DR - Remove existing node installations, install nvm, install node versions under nvm `nvm install <version>`, use the version `nvm use <version>`

If you have already installed nodejs, lets start by [removing it first](https://stackoverflow.com/questions/20711240/how-to-completely-remove-node-js-from-windows)

1. Make a note of the existing version of node and npm
    
    1. ```bash
        node --version
        npm --version
        ```
        
2. Clear cache
    
    1. ```bash
        npm cache clean --force
        ```
        
3. Uninstall nodejs from you machine
    
4. Delete all files from the below folders
    
    * `C:\Program Files (x86)\Nodejs`
        
    * `C:\Program Files\Nodejs`
        
    * `C:\Users\{User}\AppData\Roaming\npm` (or `%appdata%\npm`)
        
    * `C:\Users\{User}\AppData\Roaming\npm-cache` (or `%appdata%\npm-cache`)
        
    * `C:\Users\{User}\.npmrc` (and possibly check for that without the `.` prefix too)
        
    * `C:\Users\{User}\AppData\Local\Temp\npm-*`
        
5. Download and install the [**nvm-setup**](https://github.com/coreybutler/nvm-windows/releases) file for the most recent release
    
6. After install take a new terminal and check for the installation using the command `where nvm`
    
7. To list the installed node versions `nvm ls`
    
8. To list the available node versions to install `nvm list available`
    
9. To install required versions, use `nvm install <version>`
    

All set!, now to use a specific version of node, use the command `nvm use <version>`

<details data-node-type="hn-details-summary"><summary>References</summary><div data-type="detailsContent"><a target="_blank" rel="noopener noreferrer nofollow" href="https://github.com/coreybutler/nvm-windows#installation--upgrades" style="pointer-events: none">https://github.com/coreybutler/nvm-windows#installation--upgrades</a>, <a target="_blank" rel="noopener noreferrer nofollow" href="https://stackoverflow.com/questions/20711240/how-to-completely-remove-node-js-from-windows" style="pointer-events: none">https://stackoverflow.com/questions/20711240/how-to-completely-remove-node-js-from-windows</a>, <a target="_blank" rel="noopener noreferrer nofollow" href="https://www.freecodecamp.org/news/node-version-manager-nvm-install-guide/" style="pointer-events: none">https://www.freecodecamp.org/news/node-version-manager-nvm-install-guide/</a>, <a target="_blank" rel="noopener noreferrer nofollow" href="https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows" style="pointer-events: none">https://learn.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows</a></div></details>
