mac下完全卸载npm和ndoe方法

终端执行命令如下:
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

 

执行后验证

node -v //not found

npm -v //not found

 

来源:https://segmentfault.com/a/1190000015969295

posted @ 2023-03-09 13:06  maplethefox  阅读(471)  评论(0编辑  收藏  举报