Warning: No available formula with the name "mongodb-community#6.0" - mongodb

Trying to install mongodb server on my mac using Brew but getting this error.
Updated my brew to latest version, still egtting this error.
Command i used:
brew install mongodb-community#6.0

I figured it out myself. Here is the solution which I found out. I am using mac os on intel processor.
I first run
rm -fr $(brew --repo homebrew/core)
then
brew tap homebrew/core
then
brew tap mongodb/brew
then installed it
brew install mongodb-community#6.0
This worked for me.

Related

Mongo is not installed via Homebrew (MacOS Monterey)

I am trying to use MongoDB on MacOS Monterey, but it does not seem to work. I've installed it via Homebrew, and the
/opt/homebrew/Cellar/mongodb-community/6.0.1/bin/mongo
is missing.
brew list mongodb-community#6.0
returns:
/opt/homebrew/Cellar/mongodb-community/6.0.1/bin/install_compass
/opt/homebrew/Cellar/mongodb-community/6.0.1/bin/mongod
/opt/homebrew/Cellar/mongodb-community/6.0.1/bin/mongos
/opt/homebrew/Cellar/mongodb-community/6.0.1/homebrew.mxcl.mongodb-community.plist
/opt/homebrew/Cellar/mongodb-community/6.0.1/MPL-2
/opt/homebrew/Cellar/mongodb-community/6.0.1/THIRD-PARTY-NOTICES
You need first use:
brew tap mongodb/brew
Then use:
brew install mongodb-community#6.0
This is documented on this MongoDB page:
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/

Installing mongodb on M1 mac

I tried opening the terminal using Rosetta but when I run brew install mongodb-community#5.0 I get an error that says:
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)! To rerun under ARM use: arch -arm64 brew install ... To install under x86_64, install Homebrew into /usr/local.
However, when I run it as arch -arm64 brew install mongodb-community#5.0, it again complains with:
arch: posix_spawnp: brew: Bad CPU type in executable
Any help would be appreciated.
Thanks in advance.
There are two versions of brew:
Intel version (in /usr/local/homebrew)
ARM64 version for Apple Silicone (in /opt/homebrew/)
When you just type brew you are probably using native ARM64 version, for which there is no mongodb server yet.
You can check which version is your default with this:
$ which brew
/opt/homebrew/bin/brew
The solution I find most practical is to define alias for Intel brew like this in .zshrc:
# arm64/intel brew
alias brew86="arch -x86_64 /usr/local/Homebrew/bin/brew"
alias brewARM="/opt/homebrew/bin/brew"
# ARM64 brew is default
eval "$(/opt/homebrew/bin/brew shellenv)"
Then you can use intel brew to install intel based apps like this:
brew86 install mongodb-community
brew86 services
...
And you can use ARM64 brew to install native ARM64 stuff like this:
brew install mongosh
Important note - do not use "Open using rosetta2" to launch terminal window in which you gonna run these commands. You wish to be in native ARM64, then install Intel apps only when is absolutely needed with brew86.
For some reason even though I had Homebrew in /usr/local the one for M1 was being executed. Solved it by manually navigating in /usr/local/Homebrew/bin and running the commands with ./brew.

"No similarly named formulae found" when trying to install MongoDB on macOS

I'm trying to install MongoDB server on macOS Big Sur using brew, I'm following the documentation on the official mongo website.
I run the following command:
brew tap mongodb/brew
after that, I run:
brew install mongodb-community#4.4
but I got the following error:
Error: No similarly named formulae found.
Error: No available formula with the name "mongosh" (dependency of mongodb/brew/mongodb-community).
It was migrated from mongodb/brew to homebrew/core.
For me homebrew-core was not tapped properly.
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
We need to remove and tap homebrew/core again.
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
After this we need to tap mongodb/brew
brew tap mongodb/brew
And then install mongodb-community
brew install mongodb-community
It worked for me.
As the error message shows, you need to first install mongosh(https://github.com/mongodb-js/mongosh#readme).
Steps:
brew update
brew install mongosh
brew install mongodb-community .
Should fix your problem.
Steps:
brew untap mongodb/brew
brew tap mongodb/brew
brew install mongodb-community
fix my problem.
Run this command in terminal:
rm -fr $(brew --repo homebrew/core)
Then try:
brew install mongosh
or
brew install mongodb-community#4.4
It work perfectly
You need to remove tap by running brew untap mongodb/brew.
Then you can run brew install mongodb-community#4.4 and it will install from the core homebrew tap, where the package now lives.
For me, this was linked to the homebrew core being missing as per https://github.com/Homebrew/discussions/discussions/1512
steps: run the command
brew config
if you get
Core tap HEAD: (none) in the body, then likely you had the same issue as me. Run the command
brew tap homebrew/core
You can then go back to the installation steps
brew tap mongodb/brew
brew install mongodb-community#6.0
And everything should install correctly (it did for me anyway).
It seems like the mongosh formula that MongoDB Community 4.4 depends on was migrated from the mongodb/brew tap to the homebrew/core tap. You can try installing the mongosh formula from the homebrew/core tap first before installing MongoDB Community 4.4.
To do this, run the following command:
brew install mongosh
Then, try installing MongoDB Community 4.4 again using the following command:
brew install mongodb-community#4.4
This should install MongoDB Community 4.4 and any dependencies it requires, including the mongosh formula.
Not the latest version is 6.0. So you should use this command for it.
brew install mongodb-community#6.0
I was getting this same problem on my mac running Intel Processor.
I first run
rm -fr $(brew --repo homebrew/core)
then
brew tap homebrew/core
then
brew tap mongodb/brew
then installed it
brew install mongodb-community#6.0
This worked for me.

Error while installing mongodb-community using Homebrew

Hello, i'm getting this error while i'm trying to install MongoDB using Homebrew.
Updating Homebrew...
==> Installing mongodb-community from mongodb/brew
Error: An exception occurred within a child process:
NoMethodError: undefined method `path' for nil:NilClass
Did you mean? paths
your help please!
After several trying and searching in web, i resolved finally the problem just by installing the last version of xcode command line tools.
I literally faced the same issue today morning, I installed all software updates and nothing worked. Someone mentioned using brew update nothing.
softwareupdate --all --install --force
Running brew doctor asked to clear out command-line tools and reinstall xcode
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
I did the same, followed by installing mongo community edition, it worked!

Installing MongoDB with Homebrew

I'm relatively new to MongoDB and am trying to install MongoDB on my Mac with Homebrew, but I'm getting the following error:
Error: 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.
I ran
brew update
Then
brew install mongodb
Formula mongodb has been removed from homebrew-core. Check pr-43770 from homebrew-core
To our users: if you came here because mongodb stopped working for you, we have removed it from the Homebrew core formulas since it was migrated to a non open-source license.
Fortunately, the team of mongodb is maintaining a custom Homebrew tap. You can uninstall the old mongodb and reinstall the new one from the new tap.
# If you still have the old mongodb installed from homebrew-core
brew services stop mongodb
brew uninstall homebrew/core/mongodb
# Use the migrated distribution from custom tap
brew tap mongodb/brew
brew install mongodb-community
brew services start mongodb-community
Check mongodb/homebrew-brew for more info.
With regards to macOS Big Sur and Homebrew the mongodb documentation states: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/
You should install MongoDB 4.4 Community Edition which supports macOS 10.13 or later, Therefor these steps will be helpful.
SOLUTION 1:
If you have previously installed an older version of the formula, you may encounter a ChecksumMismatchError to fix that:
Remove the downloaded .tgz archive.
brew untap mongodb/brew && brew tap mongodb/brew
Retap the formula.
brew install mongodb-community#4.4
SOLUTION 2:
If you haven't installed any version of the formula.
1, Install the Xcode command-line tools and the Homebrew from https://brew.sh/#install
xcode-select --install
2, Tap the MongoDB Homebrew Tap:
brew tap mongodb/brew
3, Verify installation prerequisites in the macOS Terminal:
brew tap | grep mongodb
4, install MongoDB
brew install mongodb-community#4.4
Note: The installation includes:
• The mongod server,
• The mongos sharded cluster query router,
• The mongo shell
refer to this screenshot:
Finally to run MongoDB (i.e. the mongod process) as a macOS service, issue the following:
brew services start mongodb-community#4.4
screenshot:
first install mongodb
brew tap mongodb/brew
Secondly install using this command. mangodb successfully installed
brew install mongodb-community#4.0
You will get the output
==> CaveatsTo have launchd start mongodb/brew/mongodb-community now and restart at login:
brew services start mongodb/brew/mongodb-community
Or, if you don't want/need a background service you can just run:
mongod --config /usr/local/etc/mongod.conf
==> Summary
🍺 /usr/local/Cellar/mongodb-community/4.2.2: 21 files, 274.5MB, built in 2 minutes 46 seconds
brew services start mongodb/brew/mongodb-community
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-commu
Try this code in your terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
And then:
brew tap mongodb/brew
Finally:
brew install mongodb-community#4.0
~ % brew services run mongodb-community
/usr/local/opt/mongodb-community/homebrew.mxcl.mongodb-community.plist: service already loaded
Error: Failure while executing
/bin/launchctl bootstrap gui/501 /usr/local/opt/mongodb-community/homebrew.mxcl.mongodb-community.plist
exited with 17.
In MacOs Catalina doesn't work properly for me.
After the installation (https://zellwk.com/blog/install-mongodb/) i had to add permission to "/tmp/mongodb-27017.sock"
sudo chown -R `id -un` /tmp/mongodb-27017.sock
and the command "mongod" seems to ignore the config file (mongod.conf) in "/usr/local/etc" so i have to always launch it with the dbpath argument
mongod --dbpath /usr/local/var/mongodb
even if the same path is specified in the config file.
Also using "mongod" with configuration file doesn't work for me
mongod -f /usr/local/etc/mongod.conf
or
mongod --config /usr/local/etc/mongod.conf
I solved all these issues starting the mongodb via brew services. That worked well without issues and takes the parameters from the right configuration file.
brew services run mongodb-community
Just go for
brew tap mongodb/brew
Homebrew at times won’t get installed in max while the OS is updated , like recently Max OS Ventura - it’s not supported , we can quickly install Mongo DB without homebrew just by using some commands in terminal , checkout the details here : https://medium.com/#pratheushcmohan/install-mongodb-in-mac-without-using-home-brew-23b2556ff930