Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danclegg/caaccfdcf8ec63ef98faa1c49c4c6917 to your computer and use it in GitHub Desktop.
Save danclegg/caaccfdcf8ec63ef98faa1c49c4c6917 to your computer and use it in GitHub Desktop.
Uninstall nodejs from OSX Yosemite
# first:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# One way 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 brew uninstall node in your terminal
brew uninstall node
# Check your Home directory for any "local" or "lib" or "include" folders, and delete any "node" or "node_modules" from there
ls ~/local/node*
ls ~/lib/node*
ls ~/include/node*
# 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
# (optional additional steps)
sudo rm -rf /usr/local/share/man/man1/node.1
sudo rm -rf /usr/local/lib/dtrace/node.d
sudo rm -rf ~/.npm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment