尝试在macOS上安装MongoDB时出现"No similarly named formulae found"错误。

10

我正在尝试使用brew在macOS Big Sur上安装MongoDB服务器,我正在遵循官方mongo网站上的文档。
我运行以下命令:

brew tap mongodb/brew

之后,我运行:

brew install mongodb-community@4.4

但我遇到了以下错误:

错误:找不到类似名称的公式。
错误:没有名为“mongosh”的可用公式(mongodb/brew/mongodb-community 的依赖项)。
它已从 mongodb/brew 迁移到 Homebrew/core。


你尝试过点击homebrew/core并手动安装mongosh吗? - Victor Wilson
@tao 抱歉,这是我的失误,我重新打开了它。你可以在那里放置答案,非常感谢。 - Ayoub k
8个回答

5
对我来说,homebrew-core 没有被正确地安装到程序库中。
 brew doctor


Warning: Homebrew/homebrew-core was not tapped properly! Run:
  rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
  brew tap homebrew/core

Warning: Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
  git -C $(brew --repo homebrew/core) checkout master

我们需要再次移除并安装homebrew/core。
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core

在此之后,我们需要点击mongodb/brew。
brew tap mongodb/brew

然后安装mongodb-community

brew install mongodb-community

这对我有用。


4

步骤:

  1. brew untap mongodb/brew
  2. brew tap mongodb/brew
  3. brew install mongodb-community

修复我的问题。


拒绝解锁mongodb/brew,因为它包含以下已安装的配方或桶: - MartianMartian

4

2

在终端中运行以下命令:

rm -fr $(brew --repo homebrew/core)

那么尝试一下:

 brew install mongosh 

或者

brew install mongodb-community@4.4

它完美地工作了。


他正在询问mongodb-community@6.0的相关内容。因此,第一步将是您在答案中提到的步骤,但第二步将是运行brew install mongodb-community@6.0或者当前版本的命令。 - Zohaib Amir
1
如果他想要最新版本,那么他可以使用;如果需要特定版本,那么你是完全正确的,我会更新我的答案。 - Sushant Gosavi

0
对于我来说,这与homebrew核心缺失有关,具体情况请参见https://github.com/Homebrew/discussions/discussions/1512 步骤:运行命令 brew config 如果在正文中得到 Core tap HEAD: (none),那么很可能你和我遇到了相同的问题。运行以下命令。
brew tap homebrew/core

然后您可以返回安装步骤


brew tap mongodb/brew

brew install mongodb-community@6.0 

一切都应该正确安装(至少对我来说是这样)。


0

我在我的Mac上遇到了同样的问题,它运行着Intel处理器。

我首先运行

rm -fr $(brew --repo homebrew/core)

那么

brew tap homebrew/core

那么

brew tap mongodb/brew

然后安装它

brew install mongodb-community@6.0

这对我有效。


0
你需要运行brew untap mongodb/brew来移除tap。
然后你可以运行brew install mongodb-community@4.4,它将从核心homebrew tap安装,这是该软件包现在所在的位置。

0

看起来 MongoDB Community 4.4 依赖的 mongosh 公式已从 mongodb/brew 转移到 homebrew/core。在安装 MongoDB Community 4.4 之前,您可以先尝试从 homebrew/core 安装 mongosh 公式。

要执行此操作,请运行以下命令:

brew install mongosh

然后,尝试使用以下命令重新安装MongoDB Community 4.4:

brew install mongodb-community@4.4

这将安装MongoDB Community 4.4及其所需的任何依赖项,包括mongosh公式。

最新版本不是6.0。因此,您应该使用此命令进行安装。

brew install mongodb-community@6.0

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