How to Uninstall Node.js from Your System
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:
makefile1 C:\Program Files\nodejs2 C:\Users\<YourUsername>\AppData\Roaming\npm3 C:\Users\<YourUsername>\AppData\Roaming\npm-cache4 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:
1 node -v2 npm -v
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:
1 brew uninstall node
2. Manually Delete Files
Remove all Node.js-related files:
1 sudo rm -rf /usr/local/lib/node_modules2 sudo rm -rf /usr/local/include/node3 sudo rm -rf /usr/local/bin/node4 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 users2 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:
1 node -v2 npm -v
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 nodejs2 sudo apt-get autoremove
For nvm (Node Version Manager) users, uninstall with:
1 nvm deactivate2 nvm uninstall node
2. Delete Node.js Files
1 sudo rm -rf /usr/local/lib/node_modules2 sudo rm -rf /usr/local/include/node3 sudo rm -rf /usr/local/bin/node4 sudo rm -rf ~/.npm ~/.nvm ~/.node
3. Remove Node.js from Environment Variables
Edit your shell configuration file:
1 nano ~/.bashrc # For Bash users2 nano ~/.zshrc # For Zsh users
Remove any Node.js-related paths and restart your terminal.
4. Verify Removal
1 node -v2 npm -v
If Node.js is fully removed, the commands will return "command not found".
Node.js is now completely removed from your computer! 🎉