Completely Uninstall Node.js on OS X

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.*
WARNING: This snippet is very--VERY--powerful. Should you choose to use it, make sure you either (a) back-up your system or (b) have all of your important data backed up should anything go wrong.

Notice the first "rm" -- it isn't a "rm -rf" which, if there's a blank line on the output of sbom, it would remove ALL of /usr/local aka YOUR ENTIRE FILESYSTEM.

USE AT YOUR OWN RISK.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.