Skip to content

Instantly share code, notes, and snippets.

@cwonrails
Last active March 24, 2021 15:20
Show Gist options
  • Save cwonrails/e6924c749307220e3d96 to your computer and use it in GitHub Desktop.
Save cwonrails/e6924c749307220e3d96 to your computer and use it in GitHub Desktop.
Completely uninstall node.js and npm on Mac OSX regardless of installation method (excluding nvm.) Combined from answers here: https://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x
brew uninstall node; brew prune; sudo rm /usr/local/bin/npm; sudo rm /usr/local/share/man/man1/node.1; sudo rm /usr/local/lib/dtrace/node.d; sudo rm -rf ~/.npm; sudo rm -rf ~/.node-gyp; sudo rm /opt/local/bin/node; sudo rm -rf /opt/local/lib/node_modules; 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.*;
@ManspergerMichael
Copy link

Thank you for making this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment