How to completely remove Node and reinstall it
It might be a bit annoying to uninstall stuff. But sometimes you gotta do it.
To uninstall node completely from your machine:
brew uninstall --ignore-dependencies npm
This will handle the issue you may have with dependencies. If you have other modules like yarn or jhipster on your machine, they are dependent on node and uninstalling might not come easy.
To uninstall node in a more aggressive way:
rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*
how to install node, npm (node package manager) on Mac OSX
It is rather simple. Just go to https://nodejs.org and download and follow the steps.