You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MacBook(MacOS 12.6.1)无法用Homebrew卸载Node?求解决方案

MacOS 12.6.1下Node@14卸载失败的解决办法

你当前安装的是Homebrew的node@14版本,但执行卸载命令时用了brew uninstall node——Homebrew中node默认指向最新版,和你安装的node@14是独立的Formula,所以卸载命令未生效。

解决步骤:

  • 执行正确的卸载命令,明确指定版本:
    brew uninstall node@14 --force
    
  • 卸载完成后验证结果:
    node -v
    which node
    
  • 如果仍有残留,手动清理符号链接和安装目录:
    rm -f /opt/homebrew/opt/node@14
    rm -rf /opt/homebrew/Cellar/node@14/14.21.3
    

你的失败操作输出:

% node -v
v14.21.3

% which node
/opt/homebrew/opt/node@14/bin/node

% ls -al /opt/homebrew/opt/node@14
lrwxr-xr-x  1 me  admin  25 Mar  6 21:26 /opt/homebrew/opt/node@14 -> ../Cellar/node@14/14.21.3

% brew uninstall node --force
==> Downloading https://formulae.brew.sh/api/formula.jws.json
######################################################################## 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
######################################################################## 100.0%

% which node
/opt/homebrew/opt/node@14/bin/node

% node -v
v14.21.3

内容的提问来源于stack exchange,提问作者Saqib Ali

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 02:00:04