我的Homebrew符号链接断开了很多,该怎么办?

geo*_*gej 3 homebrew symlink node.js npm

node8个月前通过自制软件安装了。

  • 我只是尝试通过自制软件升级节点,但没有成功。

  • 相反,我得到一些鼓励我运行一行代码来对其进行修复的消息(我忘记了代码),但我认为它破坏了我的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 / grunt

    / usr / local / bin / gulp

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

vid*_*dit 5

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.
Run Code Online (Sandbox Code Playgroud)

  • 请注意,从今天起,“西梅”已被弃用;它包含在“酿造清理”中。 (2认同)