卸载node


sbom -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.*


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


如果出现

zsh: permission denied: /usr/local/lib/node_modules
zsh: permission denied: /var/db/receipts/org.nodejs.node.pkg.bom


执行命令 chmod a+x *.文件的后缀名


安装brew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"


如果安装失败

打开

https://raw.githubusercontent.com/Homebrew/install/master/install


另存为 brewinstall.rb

ruby brew install.rb


安装node


brew install node


brew link node


0条评论