Apparently, there was a /Users/myusername/local folder that contained a include with node and lib with node and node_modules. How and why this was created instead of in my /usr/local folder, I do not know.

Deleting these local references fixed the phantom v0.6.1-pre. If anyone has an explanation, I'll choose that as the correct answer.

EDIT:

You may need to do the additional instructions as well:

sudo rm -rf \
/usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}

which is the equivalent of (same as above)...

sudo rm -rf \
  /usr/local/bin/npm \
  /usr/local/share/man/man1/node* \
  /usr/local/lib/dtrace/node.d \
  ~/.npm \
  ~/.node-gyp

or (same as above) broken down...

To completely uninstall node + npm is to do the following:

  1. go to /usr/local/lib and delete any node and node_modules
  2. go to /usr/local/include and delete any node and node_modules directory
  3. if you installed with brew install node, then run brew uninstall node in your terminal
  4. check your Home directory for any local or lib or include folders, and delete any node or node_modules from there
  5. go to /usr/local/bin and delete any node executable

You may also need to do:

sudo rm -rf /opt/local/bin/node /opt/local/include/node /opt/local/lib/node_modules
sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node.1 /usr/local/lib/dtrace/node.d

Additionally, NVM modifies the PATH variable in $HOME/.bashrc, which must be reverted manually.

Then download nvm and follow the instructions to install node. The latest versions of node come with npm, I believe, but you can also reinstall that as well.

Answer from Dominic Tancredi on Stack Overflow
Top answer
1 of 16
2031

Apparently, there was a /Users/myusername/local folder that contained a include with node and lib with node and node_modules. How and why this was created instead of in my /usr/local folder, I do not know.

Deleting these local references fixed the phantom v0.6.1-pre. If anyone has an explanation, I'll choose that as the correct answer.

EDIT:

You may need to do the additional instructions as well:

sudo rm -rf \
/usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}

which is the equivalent of (same as above)...

sudo rm -rf \
  /usr/local/bin/npm \
  /usr/local/share/man/man1/node* \
  /usr/local/lib/dtrace/node.d \
  ~/.npm \
  ~/.node-gyp

or (same as above) broken down...

To completely uninstall node + npm is to do the following:

  1. go to /usr/local/lib and delete any node and node_modules
  2. go to /usr/local/include and delete any node and node_modules directory
  3. if you installed with brew install node, then run brew uninstall node in your terminal
  4. check your Home directory for any local or lib or include folders, and delete any node or node_modules from there
  5. go to /usr/local/bin and delete any node executable

You may also need to do:

sudo rm -rf /opt/local/bin/node /opt/local/include/node /opt/local/lib/node_modules
sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node.1 /usr/local/lib/dtrace/node.d

Additionally, NVM modifies the PATH variable in $HOME/.bashrc, which must be reverted manually.

Then download nvm and follow the instructions to install node. The latest versions of node come with npm, I believe, but you can also reinstall that as well.

2 of 16
722

For brew users, OSX:

To remove:

brew uninstall node; 
# or `brew uninstall --force node` which removes all versions
brew cleanup;
rm -f /usr/local/bin/npm /usr/local/lib/dtrace/node.d;
rm -rf ~/.npm;

To install:

brew install node;
which node # => /usr/local/bin/node
export NODE_PATH='/usr/local/lib/node_modules' # <--- add this ~/.bashrc

You can run brew info node for more details regarding your node installs.


consider using NVM instead of brew

NVM (node version manager) is a portable solution for managing multiple versions of node

https://github.com/nvm-sh/nvm

> nvm uninstall v4.1.0
> nvm install v8.1.2
> nvm use v8.1.2
> nvm list
         v4.2.0
         v5.8.0
        v6.11.0
->       v8.1.2
         system

you can use this with AVN to automatically switch versions as you hop between different projects with different node dependencies.

🌐
BrowserStack
browserstack.com › home › guide › removing node.js on mac using homebrew: a step-by-step guide
Removing Node.js on Mac using Homebrew: A Step-by-Step Guide | BrowserStack
April 4, 2025 - Even after uninstalling Node.js, some residual files and configurations may still be present. To remove them, run: brew cleanup · This command clears unnecessary files and dependencies left behind by Homebrew. Step 4: (Optional) Remove Dependencies ...
🌐
MacPaw
macpaw.com › how to › optimization › apps
How to uninstall Node on your Mac
February 14, 2025 - If you installed Node using Homebrew, go to Applications > Utilities and open Terminal, then type the following command: brew uninstall --force node · That will uninstall Node and all of its components.
🌐
Medium
medium.com › @inhkustkao › uninstall-node-js-and-reinstall-node-js-with-brew-3e41a090f5b4
Uninstall and Reinstall Node.js with Brew | by Kao Kao | Medium
February 19, 2019 - Uninstall and Reinstall Node.js with Brew I had installed Node.js through the official website at this page and later on found out Homebrew, a handy tool to install/uninstall packages. Learning that …
🌐
GitHub
github.com › orgs › Homebrew › discussions › 3663
Brew uninstall node potentially leaving behind files? · Homebrew · Discussion #3663
I recently upgraded to Node 16.17.0 using the installer on the official website https://nodejs.org/en, without realizing I've installed Node using homebrew previously (16.13.0). The installer put the version of node I want under /usr/local/bin while my homebrew installation was under /opt/homebrew/opt/node@16/bin/node. So I did brew uninstall node@16 which seems to have uninstalled node successfully, and now I am able to pick up the new node version:
🌐
Reddit
reddit.com › r/node › how do i uninstall node on osx?
r/node on Reddit: How do I uninstall node on osx?
January 15, 2022 -

Is there an easy way to uninstall node v16.13.2 if I installed from the package download for Max OSX Monterrey? (I have m1 macbook pro so arm version) I want to reinstall using brew because it seems my current installation isn't in the right directory and doesn't have the right file permissions. I can't find an easy solution, and some of the other instructions I find say to cd into /usr/local/include which doesn't seem to exist on my version. It seems like there should just be an uninstall script or something to remove node

🌐
iMyMac
imymac.com › powermymac › how to completely uninstall node on mac (node.js and npm)
How to Completely Uninstall Node on Mac (Node.js and NPM)
July 15, 2024 - The most used method to uninstall Node on Mac and delete npm is using Homebrew command (more suitable for the users that got and installed the Node.js from Homebrew): Type in “brew uninstall --force node”. Once you have executed this command, ...
Find elsewhere
🌐
Nektony
nektony.com › home › how to › how to uninstall node.js on a mac
How to Uninstall Node from a Mac - Guides for Any Version
June 30, 2025 - How do I choose the best way to uninstall Node on Mac? ... Run brew uninstall node in Terminal.
🌐
Setapp
setapp.com › how-to › how-to-uninstall-node-on-a-mac
How to uninstall Node.js on a Mac
May 3, 2024 - Click Uninstall. ... If you’ve installed Node.js using Homebrew, installation involves the Mac Terminal. Type in the command brew uninstall --force node.
🌐
Codedamn
codedamn.com › news › node.js
How to uninstall node.js from mac
June 2, 2023 - It deletes all the traces of Node in just one go. We just have to type the command as shown below. brew uninstall node · We can also use Homebrew for installing Node by using the command shown below ·
🌐
Wikitechy
wikitechy.com › tutorials › javascript › how-do-we-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x
javascript tutorial - How do we completely uninstall Node.js, and reinstall from beginning(Mac OS X) - By Microsoft Award MVP - Learn in 30sec javascript - java script | wikitechy
The latest versions of node come with npm, WE believe, but we can also reinstall that as well. ... brew uninstall node; # or `brew uninstall --force node` which removes all versions brew prune; rm -f /usr/local/bin/npm /usr/local/lib/dtrace/node.d; rm -rf ~/.npm;
🌐
Super User
superuser.com › questions › 1806029 › uninstall-and-reinstall-node
node.js - uninstall and reinstall node - Super User
Hey I dont think i get you right, if you are trying to uninstall node.js? but if you are trying to do that you can do it by the following steps: brew uninstall node; # or `brew uninstall --force node` which removes all versions brew cleanup; ...
🌐
Medium
medium.com › @donald.murillo07 › how-to-uninstall-node-js-from-macos-2023-540531994874
How To Uninstall Node.js From MacOs 2023 | by Donald Murillo | Medium
April 25, 2023 - Run the following command in Terminal to uninstall Node.js: brew uninstall node · Press Cmd + Space to open Spotlight search, type in "Terminal," and hit Enter to open the Terminal app.
🌐
Bacancy Technology
bacancytechnology.com › qanda › node › uninstall-node
How to Uninstall Node Using NVM and from Mac?
August 7, 2023 - How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X) NVM · nvm uninstall x.x.x · Brew · brew uninstall node · brew cleanup · rm -f /usr/local/bin/npm /usr/local/lib/dtrace/node.d · rm -rf ~/.npm · Work with our skilled Node developers to accelerate your project and boost its performance.
🌐
Stack Abuse
stackabuse.com › how-to-uninstall-node-js-from-mac-osx
How to Uninstall Node.js from Mac OSX
March 14, 2017 - The Homebrew method is arguably one of the easiest ways to get Node on and off your system. The command to remove it is just as simple as the command to install it. Assuming you used brew install node to install it, just execute this to get rid of it:
🌐
GitHub
gist.github.com › TonyMtz › d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite · GitHub
Uninstall nodejs from OSX Yosemite. GitHub Gist: instantly share code, notes, and snippets.
🌐
MacKeeper
mackeeper.com › blog › mac tutorials › how to uninstall node.js on mac?
How to Uninstall Node.js on Mac? How to Remove It?
June 24, 2025 - This is probably the easiest way to remove Node.js on Mac. Simply bring up Terminal on your Mac and type the following command: “brew uninstall — force node” (omit the quotation marks).
🌐
GitHub
github.com › Homebrew › brew › issues › 14135
brew uninstall node.js bug · Issue #14135 · Homebrew/brew
August 9, 2022 - $ $ brew uninstall node@12.14.8 --force Traceback (most recent call last): 11: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `<main>' 10: from /usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require_relative' 9: from /usr/local/Homebrew/Library/Homebrew/global.rb:29:in `<top (required)>' 8: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 7: from /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require' 6: from /usr/local/Homebrew/Library/Homebrew/os.rb:3:in `<top (required)>' 5: from /usr/local/Homebrew/Library/Homebrew/os.rb:21:in `<module:OS>' 4: from /usr/local/Homebrew/Library/Homebrew/os/mac.rb:58:in `prerelease?'
Published   Nov 10, 2022
🌐
GitHub
gist.github.com › dotcomputercraft › b7283bd52f4b5389e748
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X) · GitHub
:( Copy link · Better with homebrew from the terminal: $ brew uninstall node · Copy link · Unfortunately homebrew has a habit of corrupting Node installations on OSX. Copy link · I'm 80% confident I've buggered nodejs on my new MacBook by ...