在安装tig时,HomeBrew在安装依赖项时显示以下问题:

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/a2x
/usr/local/bin is not writable.

You can try again using:
  brew link asciidoc

当前回答

我发现以下与Sophos反病毒用户相关:

https://stackoverflow.com/a/32981184

https://community.sophos.com/products/free-antivirus-tools-for-desktops/f/17/t/10029

简而言之,Sophos正在更改某些/usr/local目录的权限。Sophos已经对此进行了修补,该修复包含在9.4.1版本中。

其他回答

我的问题是

Error: Could not symlink share/man/man7/ABORT.7
/usr/local/share/man/man7 is not writable.

Chown并没有帮上忙,但我听从了酿酒医生的建议,这个警告帮助了我:

Warning: Broken symlinks were found. Remove them with `brew prune`:
/usr/local/share/man/man3/* 

酿造后的西梅都工作得很好!

在做brew链接节点时,我还遇到了以下问题:

Error: Could not symlink include/node/usr/local/include is not writable.

Linking /usr/local/Cellar/node/9.3.0... Error: Permission denied @ dir_s_mkdir - /usr/local/lib

要解决上述问题,只需转到/usr/local/并检查文件夹“include”和“lib”的可用性,如果这些文件夹不可用,只需手动创建它们。

然后再次运行brew install node

对于那些在运行Mac OS High Sierra时遇到这个问题的人(在这篇文章发表4年后),这里概述的步骤为我解决了这个问题。基本上只是概述卸载和重新安装brew。

https://medium.com/@mrkdsgn/brew-error-on-macos-high-sierra-check-you-have-permission-to-write-to-usr-local-e8bd1c6a22d4

运行这些步骤后,brew link工作得非常好!

我发现以下与Sophos反病毒用户相关:

https://stackoverflow.com/a/32981184

https://community.sophos.com/products/free-antivirus-tools-for-desktops/f/17/t/10029

简而言之,Sophos正在更改某些/usr/local目录的权限。Sophos已经对此进行了修补,该修复包含在9.4.1版本中。

对我来说,解决方案是运行brew update。

所以,先做这个。

对于熟悉自制啤酒的人来说,这可能是正常的做法,但我不是这样的人。

编辑:我发现我需要通过运行brew doctor来更新,这是@kinnth对同一问题的回答所建议的。

一般的故障排除工作流可能是这样的: 1. 运行brew更新 2. 如果这对运行brew doctor没有帮助,就按照它的指示去做 3.如果这对检查堆栈溢出没有帮助的话