自制 – 重复“链接”错误.这里的根本问题是什么?

所以我一直在使用自制软件在我的mac上安装各种软件包/库/程序.我一直遇到一个问题,在这个问题中,自制软件告诉我,我的酒窖中有无链接的桶.

例如,在运行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链接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链接–overwrite –dry-run phantomjs给出以下消息:

Would remove:
/usr/local/bin/phantomjs -> /usr/local/lib/node_modules/phantomjs/bin/phantomjs

我可能会继续覆盖,但每次我尝试使用自制软件安装时都会发生这种情况.为什么?为什么自制软件不按预期工作?

谢谢.

据我所知,看起来你以前做过:

% sudo npm install -g phantomjs

在这种情况下,您应该执行以下操作:

% sudo npm uninstall -g phantomjs
% brew link --overwrite phantomjs
相关文章