我尝试使用命令在 M1 Mac Mini 上安装 Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
正如文档中所述。
然后中途出现这个错误
==> Tapping homebrew/core
remote: Enumerating objects: 1107077, done.
remote: Counting objects: 100% (228/228), done.
remote: Compressing objects: 100% (157/157), done.
error: 545 bytes of body are still expected.44 MiB | 341.00 KiB/s
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: index-pack failed
Failed during: git fetch --force origin refs/heads/master:refs/remotes/origin/master
myuser~ %
这更多是 github checkout 问题而不是 Homebrew 问题,checkout 这个建议:
这可能是您的网络问题。如果网络太慢,可能会意外断开连接。
如果您的互联网状况良好并且仍然收到此消息,则可能是发布缓冲区存在问题。您可以通过在cmd中执行以下命令来解决它。
git config --global http.postBuffer 157286400
更改 http.postBuffer 对我来说不起作用(在 M1 Mac 上),但禁用 HTTP/2 并使用 HTTP/1.1 却有效:
git config --global http.version HTTP/1.1