Key Takeaways

  • Uninstalling Node.js requires careful attention to ensure that no residual files or processes remain.
  • This guide explains how to uninstall Node.js and npm completely from Windows 10/11, macOS, Ubuntu, and Linux based on how Node.js was installed.
  • By following these steps, you will completely remove Node.js, npm, environment settings, and any cached data from your computer without leaving anything behind.

Ā 

Ā To uninstall Node.js completely, first check how it was installed, then remove the app/package, npm cache, global modules, PATH entries, and version-manager files. You may need to uninstall Node.js when switching versions, troubleshooting issues, or clearing system clutter. Knowing how to Uninstall Node JS correctly ensures that all components, including npm, are removed without leaving behind residual files or affecting future installations.Ā 

Preparing for Uninstallation

Before You Start: Check Version, Path, Install Method, and Global Packages.

  1. Back-Up Your Files: Save any important data or project files related to Node.js, including configurations within your IDE Node.js setup if you’re using one. This helps preserve settings you may want to reuse later.
  2. Check Versions: Make sure you know which versions of Node.js and npm are installed.
    • How to Check:
      • Open the terminal or command prompt.
      • Type node -v and press Enter to see the Node.js version.
      • Type npm -v and press Enter to see the npm version.

  3. Proceed with Uninstallation: Once you have backed up your files and noted the versions, you can safely uninstall Node.js.

This ensures you don’t lose important information and remove the correct versions from your system.

How to Uninstall Node.js Completely on Windows 10/11

Uninstalling Node.js on Windows involves a lot of steps to ensure that all components are completely removed. Make sure to follow each step to avoid leaving behind any residual files.

Step 1: Clear npm Cache
To begin, clear all cached data stored by npm using the command npm cache clean force. This ensures no leftover cache files interfere with future installations or affect system performance.

Step 2: Verify Cache Clearance
Once the cache is removed, make sure to run npm cache verify to confirm.

Step 3: Uninstall Node.js Application
To uninstall Node.js:

  1. Open the Control Panel.
  2. Click on ā€œPrograms and Features.ā€
  3. Find and select ā€œNode.jsā€ from the list.
  4. Click the ā€œUninstallā€ button.

This will remove Node.js from your computer.

Step 4: End Node.js Processes
Open Task Manager (Ctrl + Shift + Esc) and check for any Node.js processes that might be running. If any are active, end them to prevent interference during uninstallation. Alternatively, restarting the system can help clear all Node.js processes.

Step 5: Remove Node.js Environment Variables

Open System Properties.

Go to the Advanced tab and click onā€Æā€˜Environment Variables’.

Find and remove any Node.js paths, such as

C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
C:\Users\{User}\AppData\Roaming\npm
C:\Users\{User}\AppData\Roaming\npm-cache
C:\Users\{User}\.npmrc
C:\Users\{User}\package.json
C:\Users\{User}\package-lock.json
C:\Users\{User}\AppData\Local\Temp\npm-*

To access the directories, type appdata in the Run dialog (Win + R), then navigate to Roaming.

Step 6: Apply Changes
After removing the environment variables, ensure all changes are saved by clicking ā€œOKā€ to close each dialog box.

Step 7: Verify Uninstallation
Finally, make sure Node.js is fully removed by opening the command prompt and typing where node. If any Node.js directories still exist, manually navigate to the paths and unistall them.

How to Uninstall Node.js on Ubuntu/Linux. Organize by APT, NodeSource, Snap, NVM, manual/source install.

Step 1: Uninstall Nodejs and npm via APT

If you installed Node.js using Ubuntu’s package manager:

Command:

sudo apt-get purge nodejs npm
sudo apt-get autoremove

Ā Explanation:

This command removes Node.js, npm, and their associated configuration files. The autoremove command cleans up any unused dependencies.

Uninstall Node.js and npm via APT

Step 2: Remove Residual Files and Directories

Command:

sudo rm -rf ~/.npm ~/.node-gyp
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /usr/local/bin/node /usr/local/bin/npm

Explanation:

These commands delete user-specific and system-wide residual files and directories related to Node.js and npm.

Remove Residual Files and Directories

Step 3: Remove Node.js APT Source Entries

Command:

sudo rm /etc/apt/sources.list.d/nodesource.list
sudo apt-get update

Explanation:

This removes the NodeSource repository entry from APT sources and updates the package list.

Step 4: Uninstall Nodejs Installed via Snap

Command:

sudo snap remove node

Explanation:

If Node.js was installed using Snap, this command will remove it.

Step 5: Uninstall Node.js Installed via NVM

Command:

nvm ls
nvm uninstall <version>
rm -rf ~/.nvm

Explanation:

These commands list installed Node.js versions via NVM, uninstall a specific version, and remove NVM itself.

Uninstall Node.js Installed via NVM

Step 6: Verify Uninstallation

Command:

node -v
npm -v

Explanation:

Running these commands should result in errors indicating that Node.js and npm are no longer installed.

Uninstallation Steps for Linux (Ubuntu)

This section outlines the steps to uninstall Node.js on Ubuntu systems. Carefully execute each step to ensure a thorough uninstallation.

Step 1: Remove Node.js
To uninstall Node.js on Ubuntu, open the terminal and enter:

sudo apt-get remove nodejs

Step 2: Remove npm
To uninstall npm and Node.js, enter this command in the terminal:

sudo apt-get remove npm

This will remove both npm and Node.js from your system.

Step 3: Clean Up Residual Files
Follow Step 7 from the Windows section. Check for residual folders and files by running whereis node. Any remaining files related to Node.js should be manually uninstall to ensure a clean removal.

How to Uninstall Node.js Completely on macOS

Uninstalling Node.js on macOS can be done in two ways- using Homebrew or manually unistalling files. This section covers both methods to ensure a thorough removal.

Step 1: Remove Node.js and npm
To uninstall Node.js installed with Homebrew, open your terminal and run:

brew uninstall node

If you installed Node.js manually, you can remove it and npm by deleting these folders:

/usr/local/bin/node
/usr/local/lib/node_modules

Simply navigate to these directories and delete them to complete the uninstallation.

Step 2: Remove Residual Files
Type the following commands to delete any leftover Node.js folders after opening the terminal:

rm -rf /usr/local/bin/node
rm -rf /usr/local/bin/node_modules
rm -rf ~/.npm
rm -rf ~/.node-gyp

Step 3: Clean Up Environment Variables
Check your shell profile files (e.g., .bash_profile, .zshrc) for any environment variables related to Node.js. Edit the files and remove any Node.js references to ensure no environment variables remain.

Verifying Complete Uninstallation

To ensure a complete uninstallation, use system commands such as for Windows: where node, where npm, where npx and for macOS/Linux: command -v node, command -v npm, command -v npx, which node, whereis node to check for any remaining Node.js files or directories. Manually inspect and delete any residual folders or environment variables. These steps are important to make sure Node.js is completely removed from your computer.

As you clean up your system, you might explore advanced use cases like node js app development, especially if you’re considering a fresh stack for mobile or full-stack applications.

Troubleshooting

Issues can easily arise during the uninstallation process. For example, leftover files may prevent a clean uninstall or certain processes may remain active. If you encounter problems, use Task Manager (Windows) or Terminal (Linux/macOS) to terminate any Node.js processes and manually remove residual files.

Which Node.js Uninstall Method Should You Use?

Use the uninstall method based on how Node.js was installed on your system.

If Node.js was installed using Use this uninstall method
Windows installer Uninstall from Windows Settings or Control Panel
winget Use winget uninstall OpenJS.NodeJS or winget uninstall OpenJS.NodeJS.LTS
Chocolatey Use choco uninstall nodejs or choco uninstall nodejs-lts
nvm-windows Use nvm list and nvm uninstall <version>
Homebrew on macOS Use brew uninstall node
NVM on macOS/Linux Use nvm uninstall <version>
APT on Ubuntu/Linux Use sudo apt purge nodejs npm
NodeSource on Linux Remove Node.js package and NodeSource repository
Snap on Linux Use sudo snap remove node
Manual binary/source install Remove Node.js files from the installation path manually

Choosing the correct method is important because Node.js can leave behind files in different locations depending on the installation method.

Conclusion

ā€œUninstalling Node.js completely is easier when you know how it was installed. Windows users may need to remove Node.js through Settings, Control Panel, winget, Chocolatey, or nvm-windows. macOS users may need to check Homebrew, the official installer, or NVM. Linux users should verify whether Node.js was installed using APT, NodeSource, Snap, NVM, or a manual binary.

After uninstalling, always verify the removal using commands like node -v, npm -v, where node, or which node. If Node.js still appears, it usually means another installation path, package manager, or PATH entry is still active.

If you are uninstalling Node.js because of version conflicts, you may not need a full removal. In many cases, using a version manager such as NVM can help you switch between Node.js versions safely. Once the old version is removed, reinstall the latest stable LTS version of Node.js to keep your development environment clean and updated.ā€

Ramesh Vayavuru Founder & CEO

Ramesh Vayavuru is the Founder & CEO of Soft Suave Technologies, with 15+ years of experience delivering innovative IT solutions.

Key Takeaways

  • Uninstalling Node.js requires careful attention to ensure that no residual files or processes remain.
  • This guide explains how to uninstall Node.js and npm completely from Windows 10/11, macOS, Ubuntu, and Linux based on how Node.js was installed.
  • By following these steps, you will completely remove Node.js, npm, environment settings, and any cached data from your computer without leaving anything behind.

Ā 

Ā To uninstall Node.js completely, first check how it was installed, then remove the app/package, npm cache, global modules, PATH entries, and version-manager files. You may need to uninstall Node.js when switching versions, troubleshooting issues, or clearing system clutter. Knowing how to Uninstall Node JS correctly ensures that all components, including npm, are removed without leaving behind residual files or affecting future installations.Ā 

Preparing for Uninstallation

Before You Start: Check Version, Path, Install Method, and Global Packages.

  1. Back-Up Your Files: Save any important data or project files related to Node.js, including configurations within your IDE Node.js setup if you’re using one. This helps preserve settings you may want to reuse later.
  2. Check Versions: Make sure you know which versions of Node.js and npm are installed.
    • How to Check:
      • Open the terminal or command prompt.
      • Type node -v and press Enter to see the Node.js version.
      • Type npm -v and press Enter to see the npm version.

  3. Proceed with Uninstallation: Once you have backed up your files and noted the versions, you can safely uninstall Node.js.

This ensures you don’t lose important information and remove the correct versions from your system.

How to Uninstall Node.js Completely on Windows 10/11

Uninstalling Node.js on Windows involves a lot of steps to ensure that all components are completely removed. Make sure to follow each step to avoid leaving behind any residual files.

Step 1: Clear npm Cache
To begin, clear all cached data stored by npm using the command npm cache clean force. This ensures no leftover cache files interfere with future installations or affect system performance.

Step 2: Verify Cache Clearance
Once the cache is removed, make sure to run npm cache verify to confirm.

Step 3: Uninstall Node.js Application
To uninstall Node.js:

  1. Open the Control Panel.
  2. Click on ā€œPrograms and Features.ā€
  3. Find and select ā€œNode.jsā€ from the list.
  4. Click the ā€œUninstallā€ button.

This will remove Node.js from your computer.

Step 4: End Node.js Processes
Open Task Manager (Ctrl + Shift + Esc) and check for any Node.js processes that might be running. If any are active, end them to prevent interference during uninstallation. Alternatively, restarting the system can help clear all Node.js processes.

Step 5: Remove Node.js Environment Variables

Open System Properties.

Go to the Advanced tab and click onā€Æā€˜Environment Variables’.

Find and remove any Node.js paths, such as

C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
C:\Users\{User}\AppData\Roaming\npm
C:\Users\{User}\AppData\Roaming\npm-cache
C:\Users\{User}\.npmrc
C:\Users\{User}\package.json
C:\Users\{User}\package-lock.json
C:\Users\{User}\AppData\Local\Temp\npm-*

To access the directories, type appdata in the Run dialog (Win + R), then navigate to Roaming.

Step 6: Apply Changes
After removing the environment variables, ensure all changes are saved by clicking ā€œOKā€ to close each dialog box.

Step 7: Verify Uninstallation
Finally, make sure Node.js is fully removed by opening the command prompt and typing where node. If any Node.js directories still exist, manually navigate to the paths and unistall them.

How to Uninstall Node.js on Ubuntu/Linux. Organize by APT, NodeSource, Snap, NVM, manual/source install.

Step 1: Uninstall Nodejs and npm via APT

If you installed Node.js using Ubuntu’s package manager:

Command:

sudo apt-get purge nodejs npm
sudo apt-get autoremove

Ā Explanation:

This command removes Node.js, npm, and their associated configuration files. The autoremove command cleans up any unused dependencies.

Uninstall Node.js and npm via APT

Step 2: Remove Residual Files and Directories

Command:

sudo rm -rf ~/.npm ~/.node-gyp
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf /usr/local/bin/node /usr/local/bin/npm

Explanation:

These commands delete user-specific and system-wide residual files and directories related to Node.js and npm.

Remove Residual Files and Directories

Step 3: Remove Node.js APT Source Entries

Command:

sudo rm /etc/apt/sources.list.d/nodesource.list
sudo apt-get update

Explanation:

This removes the NodeSource repository entry from APT sources and updates the package list.

Step 4: Uninstall Nodejs Installed via Snap

Command:

sudo snap remove node

Explanation:

If Node.js was installed using Snap, this command will remove it.

Step 5: Uninstall Node.js Installed via NVM

Command:

nvm ls
nvm uninstall <version>
rm -rf ~/.nvm

Explanation:

These commands list installed Node.js versions via NVM, uninstall a specific version, and remove NVM itself.

Uninstall Node.js Installed via NVM

Step 6: Verify Uninstallation

Command:

node -v
npm -v

Explanation:

Running these commands should result in errors indicating that Node.js and npm are no longer installed.

Uninstallation Steps for Linux (Ubuntu)

This section outlines the steps to uninstall Node.js on Ubuntu systems. Carefully execute each step to ensure a thorough uninstallation.

Step 1: Remove Node.js
To uninstall Node.js on Ubuntu, open the terminal and enter:

sudo apt-get remove nodejs

Step 2: Remove npm
To uninstall npm and Node.js, enter this command in the terminal:

sudo apt-get remove npm

This will remove both npm and Node.js from your system.

Step 3: Clean Up Residual Files
Follow Step 7 from the Windows section. Check for residual folders and files by running whereis node. Any remaining files related to Node.js should be manually uninstall to ensure a clean removal.

How to Uninstall Node.js Completely on macOS

Uninstalling Node.js on macOS can be done in two ways- using Homebrew or manually unistalling files. This section covers both methods to ensure a thorough removal.

Step 1: Remove Node.js and npm
To uninstall Node.js installed with Homebrew, open your terminal and run:

brew uninstall node

If you installed Node.js manually, you can remove it and npm by deleting these folders:

/usr/local/bin/node
/usr/local/lib/node_modules

Simply navigate to these directories and delete them to complete the uninstallation.

Step 2: Remove Residual Files
Type the following commands to delete any leftover Node.js folders after opening the terminal:

rm -rf /usr/local/bin/node
rm -rf /usr/local/bin/node_modules
rm -rf ~/.npm
rm -rf ~/.node-gyp

Step 3: Clean Up Environment Variables
Check your shell profile files (e.g., .bash_profile, .zshrc) for any environment variables related to Node.js. Edit the files and remove any Node.js references to ensure no environment variables remain.

Verifying Complete Uninstallation

To ensure a complete uninstallation, use system commands such as for Windows: where node, where npm, where npx and for macOS/Linux: command -v node, command -v npm, command -v npx, which node, whereis node to check for any remaining Node.js files or directories. Manually inspect and delete any residual folders or environment variables. These steps are important to make sure Node.js is completely removed from your computer.

As you clean up your system, you might explore advanced use cases like node js app development, especially if you’re considering a fresh stack for mobile or full-stack applications.

Troubleshooting

Issues can easily arise during the uninstallation process. For example, leftover files may prevent a clean uninstall or certain processes may remain active. If you encounter problems, use Task Manager (Windows) or Terminal (Linux/macOS) to terminate any Node.js processes and manually remove residual files.

Which Node.js Uninstall Method Should You Use?

Use the uninstall method based on how Node.js was installed on your system.

If Node.js was installed using Use this uninstall method
Windows installer Uninstall from Windows Settings or Control Panel
winget Use winget uninstall OpenJS.NodeJS or winget uninstall OpenJS.NodeJS.LTS
Chocolatey Use choco uninstall nodejs or choco uninstall nodejs-lts
nvm-windows Use nvm list and nvm uninstall <version>
Homebrew on macOS Use brew uninstall node
NVM on macOS/Linux Use nvm uninstall <version>
APT on Ubuntu/Linux Use sudo apt purge nodejs npm
NodeSource on Linux Remove Node.js package and NodeSource repository
Snap on Linux Use sudo snap remove node
Manual binary/source install Remove Node.js files from the installation path manually

Choosing the correct method is important because Node.js can leave behind files in different locations depending on the installation method.

Conclusion

ā€œUninstalling Node.js completely is easier when you know how it was installed. Windows users may need to remove Node.js through Settings, Control Panel, winget, Chocolatey, or nvm-windows. macOS users may need to check Homebrew, the official installer, or NVM. Linux users should verify whether Node.js was installed using APT, NodeSource, Snap, NVM, or a manual binary.

After uninstalling, always verify the removal using commands like node -v, npm -v, where node, or which node. If Node.js still appears, it usually means another installation path, package manager, or PATH entry is still active.

If you are uninstalling Node.js because of version conflicts, you may not need a full removal. In many cases, using a version manager such as NVM can help you switch between Node.js versions safely. Once the old version is removed, reinstall the latest stable LTS version of Node.js to keep your development environment clean and updated.ā€

Ramesh Vayavuru Founder & CEO

Ramesh Vayavuru is the Founder & CEO of Soft Suave Technologies, with 15+ years of experience delivering innovative IT solutions.

logo

Soft Suave - Live Chat online

close

Are you sure you want to end the session?

šŸ’¬ Hi there! Need help?
chat 1