Skip to content

Instantly share code, notes, and snippets.

@mdeangelo272
Created March 7, 2015 00:22
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 mdeangelo272/efe9ccb009d2bdbda1cf to your computer and use it in GitHub Desktop.
Save mdeangelo272/efe9ccb009d2bdbda1cf to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# This script removes node.js and npm, that were installed using a 'pkg' package, from Mac OS X.
# It should be run using sudo
# REFERENCE: http://stackoverflow.com/questions/9044788/how-do-i-uninstall-nodejs-installed-from-pkg-mac-os-x
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom \
| while read i; do
rm /usr/local/${i}
done
rm -rf /usr/local/lib/node \
/usr/local/lib/node_modules \
/var/db/receipts/org.nodejs.*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment