macos - 在 Mac m2 Monterey 上安装 home-brew 时出现问题

今天我准备 Homebrew 啤酒。但是当我尝试在我的 MacBook m2 Monterey 上安装时出现问题。

这是我的问题?

fuadazharibrahim@fuads-MacBook-Pro ~ % brew list zsh:找不到命令:brew fuadazharibrahim@fuads-MacBook-Pro ~ %/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh )" ==> 正在检查 sudo 访问权限(可能需要您的密码)... 密码:

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

Press RETURN/ENTER to continue or any other key to abort:
==> /usr/bin/sudo /usr/sbin/chown -R fuadazharibrahim:admin /opt/homebrew
==> Downloading and installing Homebrew...
/bin/bash: line 234: /usr/local/bin/git: Bad CPU type in executable
Failed during: git init -q

我的问题是如何解决我的问题?

最佳答案

您获得的错误意味着您的 git 可执行文件存在问题。你应该:

  • 检查您的设备上是否(正确)安装了 git。这可以通过在您的终端上运行 which git 来完成。
  • 如果未安装 git(或者它的路径不正确),您需要通过以下链接手动安装/重新安装 git:https://git-scm.com/downloads .然后它将引导您到此站点下载安装程序:https://sourceforge.net/projects/git-osx-installer/ .
  • 运行安装程序,它应该正确下载和安装 git。

然后您可以继续安装 Homebrew 软件。希望这有帮助:)

https://stackoverflow.com/questions/74686453/

相关文章:

haskell - 如何测试自定义 StateT 的 Monad 实例?

javascript - 是的,当 .required() 为 false 时,会继续在同一个属性上

swift - 如何为等待函数调用添加超时

c++ - Clang 静态链接 libc++

python - Pandas dataframe,连续查找所选列中的最大值,并根据该值查找另一列的

typescript - 如何在保持默认行为的同时扩展 tsconfig 中的类型

python - 通用迭代器注释 Python

python - ModuleNotFoundError 即使模块被识别

javascript - 升级到 React 18 后检测到额外的点击。为什么?

laravel - 生产模式编译报错 "is not a function"Vue Laravel