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.
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:pkgutil --pkg-info org.nodejs.node.pkgthen prints its version./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 (pkgutil --files org.nodejs.node.pkg), all in /usr/local. If you installed tools with npm install -g, list them with npm ls -g and remove each with npm uninstall -g and its name first: that also removes their commands from /usr/local/bin.
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/corepacksudo rm -rf /usr/local/lib/node_modules /usr/local/include/node /usr/local/share/doc/nodesudo rm -f /usr/local/share/man/man1/node.1Then make macOS forget the installer’s receipts. This doesn’t touch any files:
sudo pkgutil --forget org.nodejs.node.pkgsudo pkgutil --forget org.nodejs.npm.pkgUninstall Node.js installed with Homebrew
brew uninstall nodeIf you installed a version line like node@22, use that name: brew uninstall node@22. brew list shows what Homebrew has installed. 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 autoremovenvm uninstall: remove a Node.js version installed with nvm
nvm keeps each version in ~/.nvm/versions/node. See which ones you have:
nvm lsRemove a version by its number, here Node.js 20. Its global packages go with it:
nvm uninstall 20nvm won’t remove the version in use and says «Cannot uninstall currently-active node version». Switch to another one with nvm use, or stop using nvm’s Node.js in this Terminal window with this command, then run nvm uninstall again:
nvm deactivateRemove nvm itself
These commands delete nvm together with every Node.js version and global package it installed. Your projects stay:
nvm unloadrm -rf ~/.nvm- Open your shell settings in TextEdit: run
open -e ~/.zshrcin Terminal. If you use bash, the file is~/.bash_profileor~/.bashrc. - Delete the lines nvm added: the one that starts with
export NVM_DIRand the two below it that loadnvm.shandbash_completion. - 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 nodeThe 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.
Keep your Mac tidy

MacWashing doesn’t uninstall Node.js or the versions nvm keeps: use the steps above. System Junk finds the npm, Yarn and pnpm caches your projects leave behind, next to the caches of your other apps, and shows how much each takes.
Free trial · macOS 14 or later
Questions and answers
How do I uninstall Node.js with nvm?
Run nvm ls to see the versions, then nvm uninstall with the version number. 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 run which -a node to see where it is.