在安装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

当前回答

在做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工作得非常好!

在做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

如果你打开finder中的文件夹,右键单击并选择“获取信息”,你可以进入文件夹的“共享和权限”部分,并允许“所有人”“读写”

这就是我所做的使符号链接传递此错误。此外,brew似乎也重置了文件夹上的权限,就好像你没有改变任何东西一样

我发现对于我的特定设置,以下命令是有效的

brew doctor

然后它告诉我我的错误在哪里,然后这个与上面的注释略有不同的命令。

sudo chown -R $(whoami) /usr/local/opt

对于那些不熟悉的人:

sudo chown -R YOUR_COMPUTER_USER_NAME PATH_OF_FILE