JavaScript Development Space

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

  1. Press Win + R, type appwiz.cpl, and hit Enter.
  2. Locate Node.js in the list.
  3. Right-click it and select Uninstall.
  4. Follow the uninstallation wizard.

2. Delete Remaining Files & Folders

  • Open File Explorer and delete:
    makefile
    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

  1. Press Win + R, type sysdm.cpl, and press Enter.
  2. Go to Advanced → Click Environment Variables.
  3. Find Path under System variables, and remove entries for Node.js.
  4. Click OK.

4. Verify Removal

Open Command Prompt (Win + R → type cmd → Enter) and run:

sh
1 node -v
2 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:

sh
1 brew uninstall node

2. Manually Delete Files

Remove all Node.js-related files:

sh
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:

sh
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:

sh
1 node -v
2 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:

sh
1 sudo apt-get remove --purge nodejs
2 sudo apt-get autoremove

For nvm (Node Version Manager) users, uninstall with:

sh
1 nvm deactivate
2 nvm uninstall node

2. Delete Node.js Files

sh
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:

sh
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

sh
1 node -v
2 npm -v

If Node.js is fully removed, the commands will return "command not found".

Node.js is now completely removed from your computer! 🎉

JavaScript Development Space

© 2025 JavaScript Development Space - Master JS and NodeJS. All rights reserved.