How to Completely Uninstall Node.js and NVM from Windows

CoderIndeed
0
Sometimes you need to remove Node.js from your system. This can happen if your installation becomes corrupted, npm starts behaving unexpectedly, or you simply want to install a different version of Node.js.

In this guide, we'll go through the steps to completely remove Node.js and NVM (Node Version Manager) from a Windows machine.

Step 1: Clear the NPM Cache (Optional)

Before uninstalling Node.js, you can clear the npm cache.
npm cache clean --force(code-box)

 


What does this command do?

Whenever you install a package using:
npm install <package-name>(code-box)
npm stores downloaded package data in a local cache. This cache helps speed up future installations.

On Windows, the cache is usually stored under:
%AppData%\npm-cache

Cleaning the cache is optional, but it can help remove unnecessary files before uninstalling Node.js.

Step 2: Verify the Cache Cleanup (Optional)

To confirm that the cache is healthy and has been cleaned successfully, run:
npm cache verify(code-box)

 


This command checks the cache contents and reports any issues.

Step 3: Uninstall Node.js

If Node.js was installed directly using the Windows installer, you can remove it like any other application.

1. Open Control Panel
2. Navigate to: Control Panel > Programs > Programs and Features

3. Find Node.js in the list.
4. Right-click and select Uninstall.

Once the uninstall process is complete, Node.js will be removed from your system.

What If Node.js Doesn't Appear in Programs and Features?

If you cannot find Node.js in the installed programs list, there's a good chance it was installed using NVM (Node Version Manager for Windows).

To check whether NVM is installed, open Command Prompt and run:
nvm version(code-box)

 


If a version number is displayed, you're using NVM to manage Node.js versions.

Step 4: View Installed Node.js Versions

To see all Node.js versions managed by NVM, run:
nvm list(code-box)

 


You will see output similar to:
* 22.15.0
  20.18.0
  18.20.4(code-box)
The asterisk (*) indicates the currently active version.

Step 5: Remove Node.js Versions Managed by NVM

To uninstall a specific version:
nvm uninstall 24.13.1(code-box)

 


Repeat this command for every installed version you want to remove.

Step 6: Uninstall NVM (Optional)

If you no longer need NVM, you can uninstall it as well.

Method 1: Using Programs and Features

Open:
Control Panel > Programs > Programs and Features(code-box)

 

 

If NVM appears in the list, uninstall it like any other application.

Method 2: Manual Cleanup

Delete the NVM installation folder, which is commonly located at:
C:\Program Files\nvm(code-box)
Also remove the Node.js symlink folder if it exists:
C:\Program Files\nodejs(code-box)
Finally, remove any NVM-related entries from the Windows PATH environment variable.

Verify Everything Has Been Removed

Open a new Command Prompt and run:
node -v
npm -v
nvm version(code-box)
If all three commands return a "not recognized" message, Node.js and NVM have been successfully removed from your machine.

Final Thoughts

Whether Node.js was installed directly or managed through NVM, removing it completely is straightforward once you know which installation method was used. If you're planning to reinstall Node.js, I recommend using NVM because it makes switching between versions much easier and avoids many common setup issues.


Post a Comment

0Comments

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Accept !