所以我一直在使用 Homebrew 软件在我的 mac 上安装各种包/库/程序。我一直遇到一个问题, Homebrew 软件告诉我我的酒窖中的小桶没有链接。
例如,在运行 brew install phantomjs
时我收到以下消息:
Warning: Could not link phantomjs. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link phantomjs'
Possible conflicting files are:
/usr/local/bin/phantomjs -> /usr/local/lib/node_modules/phantomjs/bin/phantomjs
我试过运行
brew link phantomjs
按照建议,并遇到类似的问题:Error: Could not symlink file: /usr/local/Cellar/phantomjs/1.9.2/bin/phantomjs
Target /usr/local/bin/phantomjs already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
brew link --overwrite formula_name
命令
brew link --overwrite --dry-run phantomjs
给出以下消息:Would remove:
/usr/local/bin/phantomjs -> /usr/local/lib/node_modules/phantomjs/bin/phantomjs
我可能会继续进行覆盖,但是每次我尝试使用 Homebrew 软件安装某些东西时似乎都会发生这种情况。为什么?为什么 Homebrew 软件没有按预期工作?
谢谢。
最佳答案
据我所知,看起来你以前做过:
% sudo npm install -g phantomjs
在这种情况下,您应该执行以下操作:
% sudo npm uninstall -g phantomjs
% brew link --overwrite phantomjs
关于Homebrew - 重复 "linking"错误。这里的根本问题是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19572764/