By Jack Szwergold
February 3, 2015

To uninstall NodeJS and NPM from macOS run the following command:

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

Then you might need to run these commands to get rid of remaining stuff:

sudo rm -rf /usr/local/lib/{node,node_modules}
sudo rm -rf /usr/local/include/{node,node_modules}
sudo rm -rf ~/{.npm,.node_repl_history}