Homebrew - repeated “linking” bug. What is the underlying issue here?

可紊 提交于 2019-12-05 16:34:58

From what I can tell, looks like you have previously done:

% sudo npm install -g phantomjs

In this case, you should do the following:

% sudo npm uninstall -g phantomjs
% brew link --overwrite phantomjs

I thought I'd take a crack at this. I ran into a similar problem today, and I think it may be related to this:

https://github.com/Homebrew/homebrew/issues/22408

Long story short, I think it has to do with how npm manages packages vs how brew does it. (I'm assuming you installed node with its defaults, which would have given you npm).

At some point you probably installed some package with npm. Maybe grunt, karma, etc..those by default end up in /usr/local/lib/node_modules.

Maybe one of those packages or its dependencies(or sub-dependencies) depended on phantomjs (I think Karma might use phantomjs?) Anyways, if now you are trying to brew install phantomjs, which is trying to make a symlink to it, that may be conflicting with the already existing symlink that npm created for you..

I think you can change the symlink path for that package so that brew permanently points to that already installed package in the node_modules folder. Sorry not to be more specific, I'm just figuring this out myself.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!