How to Uninstall Node.js from Your System
Removing Node.js fully from a system often requires more than running an uninstaller. Depending on whether Node.js was installed using packages, Homebrew, system package managers, or version managers like NVM, remnants can remain in environment variables, hidden directories, or global module folders. This guide provides a clean, complete, and platform‑specific approach for Windows, macOS, and Linux.
Windows
1. Uninstall Node.js via Control Panel
- Press
Win + R, typeappwiz.cpl, and press Enter. - Find Node.js in the program list.
- Right‑click → Uninstall.
- Follow the uninstall wizard.
2. Remove Remaining Files and Directories
Delete Node‑related folders:
C:\Program Files\nodejs
C:\Users\<YourUser>\AppData\Roaming\npm
C:\Users\<YourUser>\AppData\Roaming\npm-cache
C:\Users\<YourUser>\.npmrc3. Clean Environment Variables
- Press
Win + R, typesysdm.cpl. - Open Advanced → Environment Variables.
- Under “System variables → Path”, delete Node.js and npm paths.
- Confirm changes.
4. Verify Removal
node -v
npm -vYou should see a command not found message.
macOS
1. Uninstall via Homebrew (If installed with Brew)
brew uninstall node2. Remove Node Files Manually
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /usr/local/include/node
sudo rm -rf /usr/local/bin/node
sudo rm -rf ~/.npm ~/.nvm ~/.node3. Clean Shell Configuration
Edit your shell rc file:
nano ~/.zshrcRemove Node‑related exports or PATH entries, then reload:
source ~/.zshrc4. Verify Removal
node -v
npm -vLinux (Ubuntu / Debian)
1. Uninstall Node.js
If installed via APT:
sudo apt-get remove --purge nodejs
sudo apt-get autoremoveIf installed via NVM:
nvm deactivate
nvm uninstall node2. Clean Node.js Directories
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /usr/local/include/node
sudo rm -rf /usr/local/bin/node
rm -rf ~/.npm ~/.nvm ~/.node3. Remove PATH Entries
Edit:
nano ~/.bashrcRemove Node or npm exports.
4. Verify Removal
node -v
npm -vIf both return command not found, Node.js was fully removed.
Conclusion
Fully uninstalling Node.js requires removing global binaries, cached directories, and PATH entries. Whether you’re switching versions, resetting your environment, or resolving conflicts, following platform‑specific cleanup steps ensures Node.js is removed completely and cleanly.