How do I uninstall nodejs installed from pkg (Mac OS X)?


I installed NodeJS from pkg file on my Mac. Now I need to uninstall it. Tell me please how to do it. I tried to remove files from this list:

lsbom -f -l -s -pf /var/db/receipts/

But node is still on my computer.

1/28/2012 11:07:51 AM

Accepted Answer

I ran:

lsbom -f -l -s -pf /var/db/receipts/ \
| while read i; do
  sudo rm /usr/local/${i}
sudo rm -rf /usr/local/lib/node \
     /usr/local/lib/node_modules \

Coded into gist 2697848

Update It seems the receipts .bom file name may have changed so you may need to replace with in the above. The gist has been updated accordingly.

9/13/2015 6:46:13 PM

If you installed Node from their website, try this:

sudo rm -rf /usr/local/{bin/{node,npm},lib/node_modules/npm,lib/node,share/man/*/node.*}

This worked for me, but if you have any questions, my GitHub is 'mnafricano'.

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow