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:
makefile
C:\Program Files\nodejs C:\Users\<YourUsername>\AppData\Roaming\npm C:\Users\<YourUsername>\AppData\Roaming\npm-cache 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:
node -v
npm -vIf 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:
brew uninstall node2. Manually Delete Files
Remove all Node.js-related files:
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. Check and Remove Environment Variables
Open Terminal and edit your shell configuration file:
nano ~/.bashrc # For Bash users
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:
node -v
npm -vIf 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:
sudo apt-get remove --purge nodejs
sudo apt-get autoremoveFor nvm (Node Version Manager) users, uninstall with:
nvm deactivate
nvm uninstall node2. Delete Node.js Files
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. Remove Node.js from Environment Variables
Edit your shell configuration file:
nano ~/.bashrc # For Bash users
nano ~/.zshrc # For Zsh usersRemove any Node.js-related paths and restart your terminal.
4. Verify Removal
node -v
npm -vIf Node.js is fully removed, the commands will return “command not found”.
Node.js is now completely removed from your computer! 🎉