Homebrew 安装过程中出现错误提示

3
在安装Homebrew时,我遇到了这个错误,请问有人可以解释一下发生了什么以及解决方案吗?

==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew

Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
fatal: cannot copy '/usr/local/Cellar/git/2.19.1/share/git-core/templates/hooks/fsmonitor-watchman.sample' to '/usr/local/Homebrew/.git/hooks/fsmonitor-watchman.sample':
 Permission denied
Failed during: git init -q


1
Homebrew安装失败,复制文件时出错。 - Larme
1个回答

3

您需要授权Homebrew写入/usr/local的权限。要执行此操作,官方命令如下:

cd /usr/local && sudo chown -R $(whoami) bin etc include lib sbin share var opt Cellar Caskroom Frameworks

请查看Homebrew的官方故障排除页面了解详情。

如果您没有在/usr/local目录下安装依赖于特定权限的应用程序,您也可以运行以下命令:

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接