我有很多损坏的 Homebrew 符号链接,我该怎么办?

I have a lot of broken Homebrew symlinks, what do I do?

我在 8 个月前通过自制程序安装了 node

我从这里去哪里?我只是想通过自制软件重新安装 nodenpm 以便它们正常工作。我应该用 brew prune: 删除损坏的符号链接,还是会给我带来更多问题?谢谢。

brew prune 就是为了这个。你也可以干掉运行它看看会用--dry-run标志移除什么。

prune [--dry-run]
              Remove dead symlinks from the Homebrew prefix. This is generally not needed, but can be useful when doing DIY installations. Also remove broken  app
              symlinks from /Applications and ~/Applications that were previously created by brew linkapps.

              If --dry-run or -n is passed, show what would be removed, but do not actually remove anything.

如果你因为安装了 brew 的软件包而最终来到这里,而它的 link 似乎消失了,请重新 link 像这样:

brew unlink [package] && brew link [package]