Skip to content

Instantly share code, notes, and snippets.

@ngocongcan
Created May 31, 2018 02:26
Show Gist options
  • Save ngocongcan/103248535717939c76c3e723f59c79d9 to your computer and use it in GitHub Desktop.
Save ngocongcan/103248535717939c76c3e723f59c79d9 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Uninstall node.js
#
# Options:
#
# -d Actually delete files, otherwise the script just _prints_ a command to delete.
# -p Installation prefix. Default /usr/local
# -f BOM file. Default /var/db/receipts/org.nodejs.pkg.bom
echo "uninstall node js"
sudo npm uninstall npm -g
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
sudo rm -rf /usr/local/include/node /Users/$USER/.npm
sudo rm /usr/local/bin/node
sudo rm /usr/local/share/man/man1/node.1
sudo rm /usr/local/lib/dtrace/node.d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment