Go to /usr/local/lib
and delete any node and node_modules:
cd /usr/local/lib
sudo rm -rf node*
Go to /usr/local/include
and delete any node and node_modules directory:
cd /usr/local/include
sudo rm -rf node*
If you installed with brew install node
, then run uninstall node in your terminal:
brew uninstall node
If you have some node dependencies (like yarn
for example), uninstall all of them the same way: brew uninstall {your_node_dependency}
or just brew uninstall --ignore-dependencies node
.
Check your Home directory for any "local" or "lib" or "include" folders, and delete any "node" or "node_modules" from there. (go to /usr/local/bin and delete any node executable):
cd /usr/local/bin
sudo rm -rf /usr/local/bin/npm
sudo rm -rf /usr/local/bin/node
ls -las
You may need to do the additional instructions as well:
sudo rm -rf /usr/local/share/man/man1/node.1
sudo rm -rf /usr/local/lib/dtrace/node.d
sudo rm -rf ~/.npm
All this done, re-install the node with homebrew:
brew install node