Mac node刪除以及重新安裝案例詳解

Mac node 刪除 重新安裝

刪除

node -v

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

npm -v

官網重新下載穩定版安裝