Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: MongoDB: unknown version: mountain_lion

I am running these simple commands on mac:

brew upgrade mongodb

or

brew install mongodb

I am getting this error below:

Error: mongodb: unknown version :mountain_lion

If I run the simple command: mongo , I get this,

MongoDB shell version v4.0.3

But then I get an error saying couldn't connect to server

Worth to note, I was playing around with the command line last night and somehow deleted all of my databases from mongodb on my machine (I think). I continuously get the above error when trying install and/or update mongodb.

I am "new" to mongoDB, but I have created a few full stack projects using it over the last 5-6 months. Not sure what I did, but I also can't run node db/seeds.js either as I get errors, even though I have the data in my vscode projects.

I've tried simply updating and installing mongodb. I also tried some simple server commands but was unsuccessful.

like image 567
Tray Fleary Avatar asked Sep 02 '19 19:09

Tray Fleary


2 Answers

It seems the mongodb tap was moved. This worked for me:

  • brew uninstall mongodb
  • From https://github.com/mongodb/homebrew-brew
    • brew tap mongodb/brew
    • brew install mongodb-community
like image 175
levsa Avatar answered Oct 12 '22 11:10

levsa


🙁 Unfortunately, MongoDB has been removed from homebrew-core.

But... MongoDB team maintains a custom Homebrew tap. 😁

I've uninstalled the old MongoDB:

brew services stop mongodb

brew uninstall mongodb

and reinstalled the new tap:

brew tap mongodb/brew

brew install mongodb-community

brew services start mongodb-community

Source: mongobd/homebrew-brew Readme.md

Good luck! 🤗

like image 26
David Bendahan Avatar answered Oct 12 '22 10:10

David Bendahan