Skip to content

Instantly share code, notes, and snippets.

@yasinuslu
Last active June 13, 2022 13:31
Show Gist options
  • Save yasinuslu/30cbf2222caddd46ce9390ba0f15105a to your computer and use it in GitHub Desktop.
Save yasinuslu/30cbf2222caddd46ce9390ba0f15105a to your computer and use it in GitHub Desktop.
Uninstall node.js MacOS

How to Uninstall Node on MacOS

For some reason if you want to remove nodejs from your system and you cannot pinpoint on how you installed it in the first place, like me right now. Here is a helpful script you can use to uninstall it.

Run it as admin

#!/bin/bash
removeNode() {
rm -rf /usr/local/lib/node_modules
rm -rf /usr/local/bin/node
rm -rf /usr/local/bin/npm
rm -rf /usr/local/bin/npx
rm -rf /usr/local/include/node
rm -rf $HOME/.npm
rm -rf /usr/local/share/systemtap/tapset/node.stp
rm -rf /usr/local/lib/dtrace/node.d
rm -rf /usr/local/share/man/man1/node.1
}
removeNode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment