Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
600 views
in Technique[技术] by (71.8m points)

node.js - 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/org.nodejs.pkg.bom

But node is still on my computer.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I ran:

lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom 
| while read i; do
  sudo rm /usr/local/${i}
done
sudo rm -rf /usr/local/lib/node 
     /usr/local/lib/node_modules 
     /var/db/receipts/org.nodejs.*

Coded into gist 2697848

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...