Skip to content

Instantly share code, notes, and snippets.

@belgoros
Last active November 4, 2017 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save belgoros/5448cb0b24fa1e7129a9f40ee6c0355a to your computer and use it in GitHub Desktop.
Save belgoros/5448cb0b24fa1e7129a9f40ee6c0355a to your computer and use it in GitHub Desktop.
Remove node JS from OS X

The best way (I've found) to completely uninstall node + npm is to do the following:

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 yarnfor 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment