简体   繁体   English

如何在 Mac OS Mojave (10.14.2) 上安装 MongoDB?

[英]How can I install MongoDB on Mac OS Mojave (10.14.2)?

I tried brew update brew install mongodb and got我试过brew update brew install mongodb并得到

~ :> brew update ~ :> 酿造更新

fatal: Cannot update paths and switch to branch 'stable' at the same time.致命:无法同时更新路径和切换到分支“稳定”。 Did you intend to checkout 'refs/tags/2.0.2' which can not be resolved as commit?您是否打算签出无法解析为提交的“refs/tags/2.0.2”? fatal: Needed a single revision invalid upstream refs/tags/2.0.2 Already up-to-date.致命:需要一个单一的修订无效上游 refs/tags/2.0.2 已经是最新的。

~ :> brew install mongodb ~ :> brew install mongodb

fatal: Cannot update paths and switch to branch 'stable' at the same time.致命:无法同时更新路径和切换到分支“稳定”。 Did you intend to checkout 'refs/tags/2.0.2' which can not be resolved as commit?您是否打算签出无法解析为提交的“refs/tags/2.0.2”? fatal: Needed a single revision invalid upstream refs/tags/2.0.2 Warning: You are using macOS 10.14.致命:需要单个修订无效上游 refs/tags/2.0.2 警告:您使用的是 macOS 10.14。 We do not provide support for this pre-release version.我们不提供对此预发布版本的支持。 You may encounter build failures or other breakages.您可能会遇到构建失败或其他损坏。 Please create pull-requests instead of filing issues.请创建拉取请求而不是提交问题。 Error: Unrecognized Mach-O load command: 0x32错误:无法识别的 Mach-O 加载命令:0x32

Instead of using brew, please follow the instructions on Install MongoDB Community Edition on macOS .不要使用 brew,请按照在 macOS安装 MongoDB 社区版的说明进行操作。 In short, you need to download the tarball from the MongoDB Download Center and put it in your path.简而言之,您需要从MongoDB 下载中心下载 tarball 并将其放在您的路径中。

Alternatively, you can use a MongoDB version manager , and use commands like:或者,您可以使用MongoDB 版本管理器,并使用以下命令:

$ m 4.0.6

to install a specific version, or安装特定版本,或

$ m stable

to install the latest stable version.安装最新的稳定版本。

Catalina messed up some of the installation folders. Catalina 弄乱了一些安装文件夹。 I just ran the Brew instructions in the terminal for the MongoDB Community Edition 4.2.6 and that was easier and provides all the PATH configuration so you do not have to do so.我刚刚在 MongoDB 社区版 4.2.6 的终端中运行了Brew 指令,这更容易并提供了所有 PATH 配置,因此您不必这样做。 No messing with folders or trying to figure out which ones Catalina will and won't allow.不要弄乱文件夹或试图弄清楚 Catalina 将允许和不允许哪些文件夹。

Will save you a bit of run around if you are coming from older tutorials and want to work with MongoDB locally.如果您来自较旧的教程并希望在本地使用 MongoDB,将为您节省一些麻烦。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM