mac brew安装mongodb报错

2,523 阅读1分钟

问题

brew安装失败。

gongzhihaodeMacBook-Pro:homebrew-core gongzhihao$ brew install mongodb -v
Updating Homebrew...

--
^CError: No available formula with the name "mongodb" //仓库没有软件
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow


Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
gongzhihaodeMacBook-Pro:homebrew-core gongzhihao$

原因

因为现在非开源,仓库没有。

解决方法

设定
$ brew tap mongodb/brew

安装
安装MongoDB社区服务器的最新可用生产版本(包括所有命令行工具)。这将安装MongoDB 4.2.x:
$ brew install mongodb-community

但是mongodb官网下载极慢,基本上下载不了。解决方法?使用迅雷下载。

参考

segmentfault.com/a/119000002…

www.runoob.com/mongodb/mon…