Table of Contents
- Manual Removal
- Conclusion
In this post, we’ll learn how to uninstall Node and NPM on Windows.
The first thing you should do is clear your NPM cache. This is a good idea to do before you uninstall Node as it will remove any information that Node has cached about your dependencies.
To clear your NPM cache, run the following command:
BASH
npm cache clean --force
From there, go to your Control Panel
. You can do this by searching for Control Panel
in the search bar.
Once there, select the Programs and Features
option.
Then, find and select Node.js
and click the Uninstall
button.
This will begin the uninstallation process.
After this has finished, restart you computer so the changes can take effect.
Once you’ve restarted your computer, you should be able to run the following command to confirm that Node and NPM have been uninstalled:
BASH
node -v
npm -v
If your system cannot recognize or find these commands, then it means you’ve successfully uninstalled Node and NPM on your Windows system.
Manual Removal
If after running the above commands, you still see the Node and NPM commands return a valid version, then might need to manually remove them.
To do so, remove everything in the following directories:
BASH
C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
C:\Users\{Username}\AppData\Roaming\npm
C:\Users\{Username}\AppData\Roaming\npm-cache
Or if you prefer to use the %appdata%
environment variable, you can use these directories:
BASH
C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
%appdata%\npm
%appdata%\npm-cache
Once again, restart your computer so the changes can take effect.
Conclusion
We’ve seen how to uninstall Node and NPM on Windows.
Hopefully, you able to complete these steps successfully and uninstall Node and NPM from your Windows system!
To learn more about web development, founding a start-up, and bootstrapping a SaaS, follow me on X!
Node.js is a runtime environment built on the Chrome V8 engine that compiles JavaScript and converts it to native machine code. It is perfect for developing real-time web apps, chat applications, APIs, microservices, high-traffic websites, etc.
I am personally a big fan of Node.js, but if you are someone who tried it and has not found it suitable for your use, then this tutorial is for you.
In this tutorial, I will explain various methods to completely remove Node.js from your Windows machine. The methods will be very simple and you can choose any one which is easy for you. Let’s get started.
If you are just uninstalling Node.js because you want to install the latest version, you can upgrade it directly, see our tutorial for the full guide – How to Update Node Version on Windows, Linux, and macOS
How to Check if Node.js is Installed?
Before getting deeper into the methods for uninstalling Node.js from your system, let’s see how to check if it is actually installed or not.
Manual Check:
To manually check if you have Node.js installed on a Windows machine:
- Open File Explorer
- Go to This PC from the left sidebar
- Open C:/ drive and simply move to this file path: C:\Program Files\nodejs.
- Or, simply navigate to the file path you had originally installed Nodejs and look there for the “nodejs” directory.
Other folders to check if Node.js, NPM-related files, or global node_modules are installed on your system can be:
- 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 (make sure you look for the files or directories without the . prefix too)
- C:\Users\{User}\AppData\Local\Temp\npm-*
Using Command Prompt:
Another way to check if Node.js is installed on a Windows machine is to check it via the command line using the version of node:
- Go to Start and search for Command Prompt, then Right-click on the result and select Run as administrator
- Or, press the Win key + R to open Run. Type cmd and hit Ctrl+Shift+enter to run Command Prompt as administrator.
- Now, execute the below command:
node --version or node -v
This command returns the Node.js version if it is installed on your PC.
Uninstalling Node.js Using Apps & Features Settings
The easiest way to uninstall Node.js from Windows is via the Apps & Features settings:
- Click the start button and go to settings by clicking the gear icon.
- Click Apps.
- Under the Apps & features subheading, look for a search box and search for Nodejs.
- Click the Nodejs application.
- Lastly, click Uninstall.
- Check the file path where you installed Node. The “nodejs” directory containing the Node modules directory should now be gone.
No matter which method you use, you may be asked to restart your Windows machine. If not, it is still recommended that you do so. Sometimes, changes may take time to be reflected.
Uninstall Node.js Using Command Prompt
The fastest way to uninstall Node is by using the command line:
- Go to Start and search for Command Prompt, then Right-click on the result and select Run as administrator
- Or, press the Win key + R to open Run. Type cmd and hit Ctrl+Shift+enter to run Command Prompt as administrator.
- Now, run the following command which uses Node Package Manager to uninstall Nodejs:
- After executing, check for the “nodejs” directory in your system to see whether it has been deleted or not.
Uninstall Node.js Using Registry Editor
We can also completely uninstall Node.js using Registry Editor:
- Open Start, search for Registry Editor and click the result.
- Or, press the Win key + R to open Run. Type regedit and hit enter.
- You will be prompted by Windows saying “Do you want to allow this app to make changes?”. Click Yes.
- Now, in the path field on top, simply paste this path:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Node.js
- Next, on the sidebar on the left, you should now be able to see the Nodejs directory.
- Right-click on it and click delete.
- Now, you will need to again check in the path where you originally installed Node for the “nodejs” directory if it exists or not.
Uninstall Node.js in Windows Using Control Panel
Another quick and easy way to remove Node.js from Windows is to use the traditional Control Panel:
- Open Start and search for Control Panel.
- Or, press the Win key+R to open Run. Type control and hit enter.
- Click Programs
- Under the Programs and Features option, click Uninstall a Program
- Look for Nodejs and right-click on it.
- Now, click Uninstall.
- You will be prompted by the Control Panel by saying “Are you sure you want to uninstall Nodejs…”. Click Yes and Node.js will be completely removed.
Conclusion
In this tutorial, we have seen various methods to completely uninstall Node js from a Windows machine. Node.js can be uninstalled using the “App and Features Setting”, using the “Command Prompt”, using “Registry Editor”, and the “Control Panel”. You can choose any method that suits your preferences. The easiest method is to use “App and Features Setting” or “Control Panel”. The faster method is to use the “Command Prompt”.
If you are uninstalling it just because you find another programming language better, you may be wrong, check out our below comparisons of Node.js with other popular technologies to doubt your decision.
- Node.js vs Python
- Node.js vs PHP
- Node.js vs .NET
- Node.js vs Angular
Reference
https://stackoverflow.com/questions/20711240/how-to-completely-remove-node-js-from-windows
Matheus Mello
How to Completely Remove Node.js from Windows 😱
So, you tried uninstalling Node.js from your Windows machine but it’s still haunting you like a ghost 👻? Fear not, we’ve got you covered! In this guide, we’ll show you the easiest and most effective ways to banish Node.js from your system for good. 🚫
The Common Issue 😫
A common issue when uninstalling Node.js on Windows is that remnants of the old version can linger in your system, causing confusion and compatibility issues. This is particularly frustrating when trying to install new modules using npm.
The Easy Solution 😎
To completely remove Node.js from Windows, follow these simple steps:
-
Uninstall Node.js — Open the Control Panel, navigate to «Programs» or «Programs and Features,» find Node.js in the list, and uninstall it. This should remove most components of Node.js, but there may still be some remnants left behind.
-
Delete Node.js Folders — Next, we need to manually remove any remaining Node.js folders. These folders might contain configuration files or modules. Here’s where to find them:
C:\Program Files\Nodejs
C:\Program Files (x86)\Nodejs
C:\Users\{User}\AppData\Roaming\npm
C:\Users\{User}\AppData\Roaming\npm-cache
Replace
{User}
with your Windows username. Delete these folders if they still exist. -
Edit Environment Variables — It’s crucial to update your environment variables to remove any reference to Node.js. Here’s how:
-
Press
Win + R
to open the «Run» dialog, typesysdm.cpl
, and press Enter. -
In the «System Properties» window, go to the «Advanced» tab and click on «Environment Variables.»
-
In the «System Variables» section, find any variables starting with «NODE» or «NPM» and delete them.
-
Edit the «Path» variable and remove any references to Node.js or npm.
-
Finally, restart your machine to apply the changes.
-
-
Cleanup Registry Entries — The Windows Registry may still contain entries related to Node.js. Proceed with caution when making changes to the Registry:
-
Press
Win + R
to open the «Run» dialog, typeregedit
, and press Enter. -
In the Registry Editor, navigate to
HKEY_CURRENT_USER\Software\Node.js
and delete the Node.js key. -
Next, navigate to
HKEY_LOCAL_MACHINE\SOFTWARE\Node.js
and delete the Node.js key if it exists. -
Finally, close the Registry Editor.
-
The Compelling Call-to-Action 💪
Congratulations! You’ve successfully exorcised Node.js from your Windows machine. Say goodbye to those pesky errors and welcome a fresh start! 🎉
But hey, don’t leave just yet! If you found this guide helpful, why not share it with your tech-savvy friends? They might be struggling with the same issue and will thank you for the help. Hit that share button and spread the knowledge!
Got any questions or suggestions for future guides? We’d love to hear from you! Leave a comment below and let’s start a conversation. Happy coding! 🚀
Share this article
More Articles You Might Like
Latest Articles
To completely remove Node.js from your computer, follow the steps based on your operating system:
Windows 🖥️
1. Uninstall Node.js via Control Panel
- Press
Win + R
, typeappwiz.cpl
, and hit Enter. - Locate Node.js in the list.
- Right-click it and select Uninstall.
- Follow the uninstallation wizard.
2. Delete Remaining Files & Folders
- Open File Explorer and delete:
1 C:\Program Files\nodejs
2 C:\Users\<YourUsername>\AppData\Roaming\npm
3 C:\Users\<YourUsername>\AppData\Roaming\npm-cache
4 C:\Users\<YourUsername>\.npmrc (if exists)
3. Remove Node.js from Environment Variables
- Press
Win + R
, typesysdm.cpl
, and press Enter. - Go to Advanced → Click Environment Variables.
- Find Path under System variables, and remove entries for Node.js.
- Click
OK
.
4. Verify Removal
Open Command Prompt (Win + R
→ type cmd
→ Enter) and run:
If Node.js is removed, you’ll see a «command not found» error.
MacOS 🍏
1. Uninstall via Homebrew (If Installed with Brew)
If you installed Node.js using Homebrew, run:
2. Manually Delete Files
Remove all Node.js-related files:
1 sudo rm -rf /usr/local/lib/node_modules
2 sudo rm -rf /usr/local/include/node
3 sudo rm -rf /usr/local/bin/node
4 sudo rm -rf ~/.npm ~/.nvm ~/.node
3. Check and Remove Environment Variables
Open Terminal and edit your shell configuration file:
1 nano ~/.bashrc # For Bash users
2 nano ~/.zshrc # For Zsh users (default in macOS)
Remove any lines related to node
or npm
. Save and exit.
4. Verify Removal
Check if Node.js is gone:
If it’s removed, the commands will return «command not found».
Linux (Ubuntu/Debian-based) 🐧
1. Remove Node.js via Package Manager
If installed via apt, run:
1 sudo apt-get remove --purge nodejs
2 sudo apt-get autoremove
For nvm (Node Version Manager) users, uninstall with:
1 nvm deactivate
2 nvm uninstall node
2. Delete Node.js Files
1 sudo rm -rf /usr/local/lib/node_modules
2 sudo rm -rf /usr/local/include/node
3 sudo rm -rf /usr/local/bin/node
4 sudo rm -rf ~/.npm ~/.nvm ~/.node
3. Remove Node.js from Environment Variables
Edit your shell configuration file:
1 nano ~/.bashrc # For Bash users
2 nano ~/.zshrc # For Zsh users
Remove any Node.js-related paths and restart your terminal.
4. Verify Removal
If Node.js is fully removed, the commands will return «command not found».
Node.js is now completely removed from your computer! 🎉
Overview
Node.js is a popular runtime environment for executing JavaScript code outside of a web browser. It’s widely used for server-side applications, making it an essential tool for many developers. However, there may come a time when you need to uninstall Node.js from your system. This could be due to various reasons, such as upgrading to a new version or switching to a different development environment. In this guide, we will explore how to uninstall Node.js on different operating systems: Windows, Ubuntu, and macOS.
Uninstalling Node.js
Uninstalling Node.js is a task that may become necessary for various reasons, such as upgrading to a different version, switching development environments, or troubleshooting issues. Node.js can be uninstalled from different operating systems, each requiring specific methods. In this overview, we’ll provide a brief introduction to uninstalling Node.js on three popular environments: macOS, Ubuntu (a Linux distribution), and Windows.
macOS:
Uninstalling Node.js on macOS can be done in two primary ways: using Homebrew or manually. Homebrew is a package manager that simplifies the installation and management of software on macOS. It provides a convenient way to uninstall Node.js and related packages. Alternatively, manual removal involves locating and deleting specific directories and files associated with Node.js.
Ubuntu (Linux) :
On Ubuntu, a Linux distribution, Node.js can be uninstalled using the package manager, which offers a straightforward process. By using commands like sudo apt remove nodejs and sudo apt remove npm, users can easily remove Node.js and npm, along with their dependencies. This method ensures clean and automated removal.
Windows :
Uninstalling Node.js on Windows involves different approaches. The Control Panel provides a user-friendly way to uninstall Node.js through its graphical interface, suitable for most users. However, users may also need to manually remove Node.js by deleting directories, modifying environment variables, and, in some cases, editing the Windows Registry.
In the subsequent sections of this guide, we will explore each of these methods in detail, providing step-by-step instructions and addressing common issues that users may encounter during the Node.js uninstallation process on these environments.
Uninstalling Node.js in Windows
Using the Control Panel:
Uninstalling Node.js on a Windows operating system can be done through the Control Panel. Follow these steps:
- Open Control Panel: Press the Windows key, type «Control Panel,» and press Enter.
- Programs and Features: Click on «Programs and Features» or «Uninstall a program,» depending on your Windows version.
- Locate Node.js: Scroll through the list of installed programs and find «Node.js.» Click on it to select it.
- Uninstall: Click the «Uninstall» button at the top of the window. Follow the on-screen instructions to complete the uninstallation process.
Common Issues and Troubleshooting Tips:
If you encounter issues with uninstalling Node.js through the Control Panel, try the following troubleshooting steps :
- Check for Running Processes: Ensure that no Node.js-related processes are running in the background. You can use the Task Manager (Ctrl + Shift + Esc) to terminate any Node.js or npm processes.
- Try Rebooting: Sometimes, a reboot can release locked files or processes. After rebooting, attempt the uninstallation again.
- Use an Uninstaller Tool: If the Control Panel method still doesn’t work, consider using a third-party uninstaller tool like «Revo Uninstaller» or «IObit Uninstaller.» These tools can help remove stubborn software and leftover files.
- Manual Removal: As a last resort, you can perform manual removal of Node.js as mentioned in the original guide. This involves deleting the Node.js folder and removing environment variables manually. Be cautious when editing the Windows Registry.
- Backup Data: Before attempting any uninstallation method, back up any important projects and data associated with Node.js to prevent data loss.
By following these troubleshooting tips, you should be able to overcome common issues that may arise during the Node.js uninstallation process on Windows.
Keep in mind that uninstallation methods may vary slightly depending on the version of Windows you are using, so always refer to the specific instructions for your system.
Manually Removing Node.js:
In some cases, the standard uninstallation process may encounter issues or leave behind remnants of Node.js. Here’s a more detailed guide on manually removing Node.js from your Windows system :
- Delete Node.js Folder : Navigate to C:\Program Files\ (or C:\Program Files (x86)\ on 64-bit systems) using File Explorer. Here, find the «Node.js» folder and delete it. This step removes the program files.
- Remove Environment Variables: Node.js adds some environment variables during installation. To remove these, search for «Environment Variables» in the Windows search bar and click on «Edit the system environment variables.» Under the «System Properties» window, click on the «Environment Variables» button. In the «System variables» section, locate and select «Path,» then click «Edit.» Remove any Node. js-related paths from the list. This ensures that Node. js-related commands won’t work after uninstallation.
- Clean the Registry: Be cautious when editing the Windows Registry, as it can impact system stability if done incorrectly. To clean the Registry, press the Windows key, type «regedit,» and press Enter. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\ and HKEY_CURRENT_USER\SOFTWARE\ in the Registry Editor. Look for any «Node.js» or «npm» entries and delete them. Make sure you only delete the Node. js-related entries and nothing else.
Troubleshooting Tips and Common Issues for Manual Uninstallation on Windows:
- Permission Errors: If you encounter permission errors while deleting folders or modifying the Registry, ensure you are logged in as an administrator or have the necessary permissions.
- Incomplete Removal: If Node.js was installed in a non-standard location, you might need to search for and manually delete related files and folders.
- Backup: Before making changes to the Registry, consider creating a backup or exporting the relevant Registry keys to be safe.
- Rebot: After uninstallation, it’s a good practice to reboot your computer to ensure that any remaining processes or services related to Node.js are stopped.
- Use Uninstaller Tools: If you’re uncomfortable editing the Registry or facing persistent issues, consider using third-party uninstaller tools that can help remove Node.js completely.
Uninstalling the Node.js in Ubuntu
Uninstalling Node.js on Ubuntu is relatively straightforward if you install it using the package manager (apt). Open a terminal and follow these steps :
- Remove Node.js: Run the following command to remove Node.js:
- Remove npm: Run this command to remove npm:
- Clean Up :: After removing Node.js and npm, it’s a good practice to clean up any residual configuration files:
Troubleshooting Tips and Common Issues for Uninstallation on Ubuntu:
- Outdated or Incompatible Packages: If you encounter issues during uninstallation, ensure that your package list is up to date using sudo apt update before attempting to remove Node.js.
- Dependency Conflicts: Sometimes, other packages may depend on Node.js or npm. In such cases, you may need to consider the impact of removing Node.js and npm on other software and proceed accordingly.
- Incomplete Removal: If you encounter issues with the uninstallation, manually check for any remaining Node. js-related files or folders that may need deletion.
- Purge Option: If you want to completely remove all configuration files associated with Node.js, you can use the purge option instead of remove in the apt commands (e.g., sudo apt purge nodejs).
- Check for Node.js Versions: Depending on how you installed Node.js, you may have multiple versions installed. Use node -v and npm -v commands to check for any remaining versions and uninstall them individually.
Always exercise caution when removing packages, and be sure to back up any important data before making significant changes to your system.
Uninstalling Node.js on Mac
On macOS, you can uninstall Node.js using a package manager like Homebrew or manually. Here are both methods :
Using Homebrew :
- Open Terminal: Launch the Terminal application.
- Uninstall with Homebrew: Run the following command to uninstall Node.js and npm using Homebrew:
Homebrew is a popular package manager for macOS and Linux that simplifies the installation and management of software packages and libraries. It allows users to easily install, upgrade, and remove various software applications, tools, and dependencies from the command line. Homebrew is widely used in the developer and system administrator communities because of its simplicity and effectiveness.
Here are some key aspects of Homebrew:
- Package Management: Homebrew provides a convenient way to manage software packages on macOS. Users can install a wide range of software packages, including developer tools, programming languages, and applications, with a simple command.
- Version Control: Homebrew tracks different versions of packages and allows users to switch between them if needed. This is particularly useful when working with development tools that require specific versions.
- Dependency Management: Homebrew automatically handles dependencies, ensuring that required libraries and components are installed when you install a package. This simplifies the process of setting up development environments.
- Community Contributions: Homebrew has a vibrant community of contributors who maintain and update packages regularly. This means that users can rely on up-to-date software packages.
- Ease of Use: Homebrew is user-friendly and offers straightforward commands for package installation and management. It provides clear instructions and information about the installed packages.
Uninstalling Node.js with Homebrew, here’s why someone might choose to do so:
- Control and Organization: Homebrew allows users to have better control over the software on their system. Uninstalling Node.js with Homebrew provides a clean and organized way to remove it and its associated components.
- Version Management: If you have multiple versions of Node.js installed using Homebrew, uninstalling one version is a straightforward way to manage your development environment. You can switch between Node.js versions or remove versions you no longer need.
- Package Consistency: Some users prefer to manage all their software installations through Homebrew to maintain consistency in package management. Uninstalling Node.js via Homebrew aligns with this approach.
- Up-to-date Removal: Homebrew keeps packages up-to-date, so when you uninstall Node.js with Homebrew, you can be confident that you are removing the latest version, ensuring no remnants are left behind.
Troubleshooting Tips and Common Issues for Uninstallation on Mac using Homebrew:
- Homebrew Not Installed: If you encounter an error saying «brew: command not found,» it means you don’t have Homebrew installed. You can install it by following the instructions on the Homebrew website this.
- Permission Denied: If you receive a «Permission denied» error when running the uninstall command, you may need to use sudo to execute it with administrator privileges:
However, it’s generally recommended to avoid using sudo with Homebrew, as it can cause permissions issues.
Manual Uninstallation:
- Delete Node.js and npm Directories: Navigate to the /usr/local/lib and /usr/local/include directories and delete any «node» and «node_modules» folders.
- Remove Node.js and npm Binaries: Execute the following commands to remove Node.js and npm binaries:
Troubleshooting Tips and Common Issues for Uninstallation on Mac during manual uninstallation:
- Permission Denied: If you encounter «Permission denied» errors when running the rm commands, use sudo to execute them with administrator privileges, as shown in the commands above.
- Incomplete Removal: Sometimes, files or directories related to Node.js or npm may not be deleted due to permission issues or other factors. In such cases, manually locating and deleting these files is necessary.
- Backup First: Before executing any rm commands, make sure you have a backup of your important data and projects. Deleting system files can lead to data loss if not done carefully.
Remember that manual uninstallation should be approached with caution, and it’s essential to double-check that you are removing the right files and directories to avoid any unintended consequences or data loss.
Looking for More Than Just JavaScript? Our Full Stack Developer Course Explores Advanced Front and Back-End Techniques. Enroll Now!
Conclusion
- Uninstalling Node.js on macOS with Homebrew provides version control and simplifies removal.
- Manually uninstalling Node.js on macOS involves manual file and directory deletion for complete control.
- Using Ubuntu’s apt package manager offers a straightforward Node.js removal process.
- Uninstalling Node.js on Windows via the Control Panel is a user-friendly method.
- Manually removing Node.js on Windows may require editing the Windows Registry and careful file deletion.
- Always back up critical data before starting the uninstallation process.
- Common issues during uninstallation include «Permission denied» errors due to inadequate privileges.
- Ensure you follow best practices for directory and binary removal to prevent incomplete uninstallation.
- Deleting incorrect files or registry entries can lead to unexpected issues; proceed with caution.
- Different operating systems offer various methods, so choose the one that suits your preferences and needs.