简体   繁体   中英

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

I tried brew update brew install mongodb and got

~ :> 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? fatal: Needed a single revision invalid upstream refs/tags/2.0.2 Already up-to-date.

~ :> 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? fatal: Needed a single revision invalid upstream refs/tags/2.0.2 Warning: You are using 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

Instead of using brew, please follow the instructions on Install MongoDB Community Edition on macOS . In short, you need to download the tarball from the MongoDB Download Center and put it in your path.

Alternatively, you can use a MongoDB version manager , and use commands like:

$ 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. 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. No messing with folders or trying to figure out which ones Catalina will and won't allow.

Will save you a bit of run around if you are coming from older tutorials and want to work with MongoDB locally.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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