我有很多破碎的自制软件符号链接,我该怎么办?

我在8个月前通过自制软件安装了node

  • 我只是试图通过自制软件升级节点,它没有工作。

  • 相反,我得到了一些消息,鼓励我运行一行代码来修复它(我忘记了代码),但是我认为它破坏了我的npm,因为我的npm停止了工作,现在我得到错误: zsh: command not found: npm运行任何npm命令时。

  • 我继续完全卸载节点与本指南

  • 然后我开始用本指南通过自制软件重新安装节点

  • 当我跑啤酒医生时,我发现我有很多错误的symlinks ,包括许多npm文件,例如:

    /usr/local/share/man/man1/npm-README.1

    /usr/local/share/man/man1/npm-access.1

    /usr/local/share/man/man1/npm-adduser.1

    (以及其他大约60个npm文件和其他文件):

    在/ usr / local / bin目录/咕噜

    在/ usr / local / bin目录/一饮而尽

我从哪里出发? 我只是想通过自制软件重新安装nodenpm ,以便它们正常工作。 我应该用brew prune:删除损坏的符号链接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.