How to Completely Remove Node.js from Windows ?

We can remove the nodejs from window by uninstalling it from the programs list. Node.js is a popular JavaScript runtime used for building server-side applications. However, there may come a time when you need to remove Node.js from your Windows system completely. Whether it’s due to a corrupted installation, needing to install a different version, or simply not needing it anymore, here’s a comprehensive guide to uninstall Node.js from your Windows machine.

Steps to Completely Remove Node.js from Windows

Step 1: Whenever we install a package with the command npm install <package name>, npm stores the cache inside the user file system. The default directory where the cache data is stored on Windows is %AppData%/npm-cache. So, we need to clean the cache first. The cache can be cleaned by using the following command.

npm cache clean --force 

Step 2: After that, you can verify the cache by using the below command:

npm cache verify

Step 3: Now open the control panel in the computer. Search for Program and features. Under the program and features click on Uninstall a program. Now search for Node.js and uninstall it.

Step 4: Restart your computer or kill all node-related processes from Task Manager.

Step 5: Look for folder in your computer and if they are present remove them. The folders and files may or may not exist in your computer depending on various factors like installed version or CPU architecture.

  • C:\Program Files (x86)\Nodejs
  • C:\Program Files\Nodejs
  • C:\Users\{User}\AppData\Roaming\npm or open run and type appdata and click ok and open roaming there you will find npm.
  • C:\Users\{User}\AppData\Roaming\npm-cache or open run and type appdata and click ok and open roaming there you will find npm-cache.
  • C:\Users\{User}\.npmrc
  • C:\Users\{User}\package.json
  • C:\Users\{User}\package-lock.json
  • C:\Users\{User}\AppData\Local\Temp\npm-*                       

Step 6: After that check the environment path variables and make sure no references to npm or Node.js exist.

Step 7: If Node.js is still not uninstalled then open the command prompt and type the below command:

where node

Step 8: If Node.js is not uninstalled the command will output the location of Node.js. Go to that location and uninstall the directory.

Step 9: Restart the computer. Node.js is now completely uninstalled.

Conclusion

By following these steps, you should have completely removed Node.js and npm from your Windows system. This thorough process ensures that no residual files or environment variables are left behind, which is especially important if you plan to reinstall Node.js or switch to a different version. If you encounter any issues during the removal process, restarting your computer and repeating the steps can help resolve them.


Contact Us