Skip to content

Instantly share code, notes, and snippets.

@cwonrails
Last active March 24, 2021 15:20
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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.*;
@jasonday
Copy link

jasonday commented Jan 1, 2019

In conjunction, I also had to:
Navigate to /usr/local/share and run this command in order to make yourself the owner:
chown -R <yourusername>:<yourgroupname> systemtap

As I was also getting this error:

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/systemtap/tapset/node.stp
/usr/local/share/systemtap/tapset is not writable.

@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