【问题标题】:Does the mongocli support a formula URL for Apple M1 chips?mongocli 是否支持 Apple M1 芯片的公式 URL?
【发布时间】:2021-02-26 06:45:58
【问题描述】:

按照installation instructions,运行时:

brew tap mongodb/brew

我收到以下错误:

Error: Invalid formula: /opt/homebrew/Library/Taps/mongodb/homebrew-brew/Formula/mongocli.rb

formulae require at least a URL

Error: Cannot tap mongodb/brew: invalid syntax in tap!

我确实符合先决条件(更新 xcodebrew)。我确保运行brew updatebrew doctor

此时,我在 mongodb/homebrew-brew repo 上寻找答案,看到了一个非常 recent commit for the mongocli

显然,它定义了具有 Intel 芯片但未提及 Apple M1 芯片的 Mac 和 Linux 机器的 URL。这阻止了我目前点击 mongodb。您知道任何解决方法还是我在某个地方犯了错误?

【问题讨论】:

    标签: mongodb macos-big-sur apple-m1


    【解决方案1】:

    刚刚遇到同样的问题...

    转到 Finder > 实用程序并右键单击终端并选择“获取信息” 找到“使用 Rosetta 打开”选项并选中它。

    打开新终端并运行“brew tap mongodb/brew” 完成后关闭终端并取消选中“使用 Rosetta 打开”,再次打开终端,然后运行“brew install mongodb-community@4.4”。

    这对我有用,并且安装了 MongoDB。

    【讨论】:

    • 非常感谢,成功了。您的回答允许我点击 mongodb,然后通过避免 Apple M1 芯片上缺少 mongocli 的公式 URL 来安装它。
    【解决方案2】:

    试试下面的命令

    arch -arm64 brew install mongodb-community@4.4
    

    【讨论】:

      【解决方案3】:

      您可以在 M1 mac 上的 Rosetta 下简单地运行任何命令,只需为命令添加前缀

      arch -x86_64
      

      为您的用例尝试

      arch -x86_64 brew tap mongodb/brew 
      brew install mongodb-community@4.4  
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-01-06
        • 2021-02-23
        • 2021-09-13
        • 2022-11-10
        • 1970-01-01
        • 2021-04-10
        • 1970-01-01
        相关资源
        最近更新 更多