How to uninstall Node.js on Mac completely

How you uninstall Node.js on a Mac depends on how you installed it: with the installer from nodejs.org, with Homebrew or with nvm. Find out which one first, then remove that copy. Your projects stay where they are.

Uninstaller: a list of apps sorted by size with when each was last opened, Google Chrome selected with its app and cache sizes
  1. Open MacWashing and choose Uninstaller in the sidebar.
  2. Click Show Apps and check node in the list.
  3. Click Remove and confirm. Files that may be yours are listed as Possible and stay unchecked.

Free trial · macOS 14 or later

How was Node.js installed?

Open Terminal and run this command. It lists every copy of node Terminal can find, the one that runs first at the top:

which -a node
  • /usr/local/bin/node — the installer from nodejs.org. On an Intel Mac Homebrew uses this folder too, but only the nodejs.org installer leaves a receipt. If it is there, this command prints its version: pkgutil --pkg-info org.nodejs.node.pkg
  • /opt/homebrew/bin/node — Homebrew on a Mac with Apple silicon.
  • A path with .nvm/versions/node — nvm.

Several lines mean several copies. Remove each one the way its section below says.

How to uninstall Node.js installed from nodejs.org

The installer has no uninstaller, and nodejs.org gives no removal steps. What it put on the Mac is listed in its receipt, all in /usr/local:

pkgutil --files org.nodejs.node.pkg

If you installed tools globally with npm, list them and remove each by its name first, which also removes their commands from /usr/local/bin:

npm ls -g npm uninstall -g <package>

These commands delete Node.js, npm, npx and corepack, and every global npm package. Your projects and the npm cache in ~/.npm stay. Terminal asks for your Mac password:

sudo rm -f /usr/local/bin/node /usr/local/bin/npm /usr/local/bin/npx /usr/local/bin/corepack
sudo rm -rf /usr/local/lib/node_modules /usr/local/include/node /usr/local/share/doc/node
sudo rm -f /usr/local/share/man/man1/node.1

Then make macOS forget the installer’s receipts. This doesn’t touch any files:

sudo pkgutil --forget org.nodejs.node.pkg
sudo pkgutil --forget org.nodejs.npm.pkg

Uninstall Node.js installed with Homebrew

brew uninstall node

If you installed a version line like node@22, use that name. See what Homebrew has installed, then remove that version:

brew list brew uninstall node@22

This command then removes the formulas that were installed only as dependencies and aren’t needed anymore, the libraries Node.js used among them:

brew autoremove

nvm uninstall: remove a Node.js version installed with nvm

nvm keeps each version in ~/.nvm/versions/node. See which ones you have:

nvm ls

Remove a version by its number, here Node.js 20. Its global packages go with it:

nvm uninstall 20

nvm won’t remove the version in use and says «Cannot uninstall currently-active node version». Switch to another one, here Node.js 22:

nvm use 22

Or stop using nvm’s Node.js in this Terminal window:

nvm deactivate

Then run the uninstall command again.

Remove nvm itself

These commands delete nvm together with every Node.js version and global package it installed. Your projects stay:

nvm unload
rm -rf ~/.nvm
  1. Open your shell settings in TextEdit. If you use bash, the file is ~/.bash_profile or ~/.bashrc. In Terminal, run:
open -e ~/.zshrc
  1. Delete the lines nvm added: the one that sets NVM_DIR and the two below it that load nvm.sh and bash_completion.
  2. Save the file and open a new Terminal window.

Check that Node.js is gone

In a new Terminal window run the first command again. When it prints «node not found», no copy is left:

which -a node

The npm cache in ~/.npm is not removed with Node.js: see how to clear npm cache. To set Node.js up again, see how to install Node.js on Mac.

With MacWashing, it’s one click

Uninstaller: a list of apps sorted by size with when each was last opened, Google Chrome selected with its app and cache sizes

If Node.js came from the nodejs.org installer or from Homebrew, the Uninstaller in MacWashing lists it as node and removes node, npm and npx with it. Packages you installed with npm -g stay, and so do the versions nvm keeps: remove those with the steps above.

Free trial · macOS 14 or later

Questions and answers

Will MacWashing delete my own files when it removes an app?

No. The Uninstaller checks only what belongs to the app: its settings, caches, logs and background items. Folders that may hold your own files are listed as Possible and stay unchecked until you check them yourself, and apps go to the Trash by default, so you can put them back.

What if the app is still running?

MacWashing waits for it to quit, or quits it at your request, and only then removes its files.

Is it free to uninstall apps with MacWashing?

Yes, within the free trial: System Junk and the Uninstaller free up to 25 GB in total, with no account or card needed.

How do I uninstall Node.js with nvm?

See the versions with: nvm ls Then remove one by its number, for example: nvm uninstall 20 To remove nvm and all its versions, delete ~/.nvm and the nvm lines in ~/.zshrc.

Will uninstalling Node.js delete my projects?

No. Projects, their node_modules and lock files stay where they are. Global npm packages are removed together with the Node.js that installed them.

Why does node -v still work after I uninstalled Node.js?

Either another copy is left, installed a different way, or Terminal still runs the old one. Open a new Terminal window and see where it is with: which -a node