Mac – So I have been hit by an issue during uninstall of Node.js on my mac. I encountered some strange behaviour like npm
is still their even after having removing it with all this.
In order to delete the ‘native’ node.js installation, the following is the best way to completely uninstall node + npm:
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 need to do the additional instructions as well:
1 | sudo rm /usr/local/bin/npm |
---|---|
2 | sudo rm /usr/local/share/man/man1/node.1 |
3 | sudo rm /usr/local/lib/dtrace/node.d |
4 | sudo rm -rf ~/.npm |
5 | sudo rm -rf ~/.node-gyp |
6 | sudo rm /opt/local/bin/node |
7 | sudo rm /opt/local/include/node |
8 | sudo rm -rf /opt/local/lib/node_modules |
9 | sudo rm -rf /usr/local/include/node/ |