0

I'm having difficulty installing the MongoDB CLI onto my Apple Mac Mini M1. I have Homebrew and MongoDB Community 4.4 installed successfully, but am having issues installing the CLI for MongoDB.

I looked at the thread here, and decided to attempt the brew install mongocli from a new terminal that was using Rosetta, but I received the same error message:

> ****@********-Mac-mini ~ % brew install mongocli Error: formulae
> require at least a URL
> /opt/homebrew/Library/Homebrew/formula.rb:253:in
> `determine_active_spec'
> /opt/homebrew/Library/Homebrew/formula.rb:206:in `initialize'
> /opt/homebrew/Library/Homebrew/formulary.rb:153:in `new'
> /opt/homebrew/Library/Homebrew/formulary.rb:153:in `get_formula'
> /opt/homebrew/Library/Homebrew/formulary.rb:366:in `factory'
> /opt/homebrew/Library/Homebrew/cli/parser.rb:648:in `block in
> formulae' /opt/homebrew/Library/Homebrew/cli/parser.rb:644:in `map'
> /opt/homebrew/Library/Homebrew/cli/parser.rb:644:in `formulae'
> /opt/homebrew/Library/Homebrew/cli/parser.rb:301:in `parse'
> /opt/homebrew/Library/Homebrew/cmd/install.rb:132:in `install'
> /opt/homebrew/Library/Homebrew/brew.rb:122:in `<main>'

Do you have any suggestions on how to approach this?

1 Answers1

1

mongocli is not yet available for M1 (arm64)

To install mongocli you can install brew for intel (x86_64) along with brew for m1

Switch bash to x86_64

arch -x86_64 bash

Install brew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

It will install brew for x86_64 under

/usr/local/homebrew/bin/brew 

You can create alias for brew for easier access as

alias brew_intel="arch -x86_64 /usr/local/homebrew/bin/brew"

Install mongocli

brew_intel tap mongodb/brew  
brew_intel install mongocli                                                               

Creat an allias or add mongocli to path

alias mongocli="/usr/local/homebrew/Cellar/mongocli/1.13.0/bin/mongocli"

Now you can run mongocli

mongocli --help
CodeforCore
  • 675
  • 6
  • 9