brew链接错误libpng和libtiff

Was*_*uel 5 macos homebrew elixir

我尝试使用自制软件安装elixir,我得到以下错误

==> Pouring libtiff-4.0.3.yosemite.bottle.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Run Code Online (Sandbox Code Playgroud)

文件存在 - /usr/local/lib错误:文件存在 - /usr/local/lib

我跑了brew doctor,我看到了这个

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that  depend on
those kegs to fail to run properly once built. Run `brew link` on these:

libpng
libtiff
Run Code Online (Sandbox Code Playgroud)

所以我跑了brew link libpng,我得到了这个

Linking /usr/local/Cellar/libpng/1.6.17... Error: File exists - /usr/local/lib
Run Code Online (Sandbox Code Playgroud)

我不知道什么是错的.任何帮助

Cha*_*ata 0

似乎在您的/usr/local/lib文件夹中存在现有libpng符号,因此brew不想覆盖它们。它是 的依赖项elixir,因此它会停止安装。

如果您使用 MacPorts 或 Homebrew 或手动安装任何内容,则依赖关系可能会发生冲突。最好以互斥的方式使用其中之一。

如果您不打算从源代码构建软件包,那么总体上使用 Homebrew 是一个可行的选择,因为它易于使用。

Homebrew 并不像您期望的那样工作。keg默认情况下,它有一个基本目录来安装name的工件Cellar,尽管它是可配置的。通常,您会将二进制文件复制到/usr/local/bin,将库复制到/usr/local/lib,将头文件复制到/usr/local/include等等...但是,Homebrew 将它们安装到自己的目录中,并在这些目录上创建符号链接,以使它们以相同的方式运行。

您可能会发现命令错误(或不兼容)brew doctor。它会告诉您冲突的符号/文件。您可以手动从文件系统中删除它们,然后brew将创建指向其基目录的符号链接(根据您的brew link $PACKAGE_NAME命令)。

实验

当我突然决定在我的计算机上做一件小事时,brew doctor它确实输出了一些意想不到的头文件,如下所示:

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Run Code Online (Sandbox Code Playgroud)

然而,它还指出,如果一切正常,这些都是没有意义的:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Run Code Online (Sandbox Code Playgroud)

输出的前几行:

Unexpected header files:
  /usr/local/include/node/android-ifaddrs.h
  /usr/local/include/node/ares.h
  ...
Run Code Online (Sandbox Code Playgroud)

这不是我的个人计算机,但似乎有人node手动安装到这台计算机(实际上是用户)。在这种情况下,尝试通过安装它或任何依赖于它的brew东西都会失败,因为即将到来的头文件将与预安装的头文件发生冲突。