我有很多损坏的 Homebrew 符号链接,我该怎么办?
I have a lot of broken Homebrew symlinks, what do I do?
我在 8 个月前通过自制程序安装了 node
。
我刚刚尝试通过自制软件升级节点,但没有成功。
相反,我收到了一些消息,鼓励我 运行 一行代码来修复它(我忘记了代码),但我认为它破坏了我的 npm,因为我的 npm 停止了工作,我现在得到错误: zsh: command not found: npm
when 运行ning any npm command.
我使用 this guide
完全卸载节点
然后我开始使用this guide
通过自制软件重新安装节点
当我运行 brew doctor 我发现我有很多坏的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
我从这里去哪里?我只是想通过自制软件重新安装 node
和 npm
以便它们正常工作。我应该用 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]
我在 8 个月前通过自制程序安装了 node
。
我刚刚尝试通过自制软件升级节点,但没有成功。
相反,我收到了一些消息,鼓励我 运行 一行代码来修复它(我忘记了代码),但我认为它破坏了我的 npm,因为我的 npm 停止了工作,我现在得到错误:
zsh: command not found: npm
when 运行ning any npm command.我使用 this guide
完全卸载节点
然后我开始使用this guide
通过自制软件重新安装节点
当我运行 brew doctor 我发现我有很多坏的
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
我从这里去哪里?我只是想通过自制软件重新安装 node
和 npm
以便它们正常工作。我应该用 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]