mongoose 在MacOS终端上安装MongoDB时遇到问题

ct2axkht  于 2022-11-13  发布在  Go
关注(0)|答案(4)|浏览(159)

我正在尝试将mongoDB安装为macOS服务,但遇到了一些错误
1.我先把终端放进去
brew tap mongodb
什么都没发生。
1.但是,当我奔跑的时候:
brew install mongodb-community@5.0
我收到:
Warning: No available formula with the name "mongosh" (dependency of mongodb/brew/mongodb-community). Did you mean mongocli?
==> Searching for similarly named fo This similarly named formula was found: mongocli ✔
To install it, run: brew install mongocli ✔ It was migrated from mongodb/brew to homebrew/core.
1.最后,当我跑
brew services start mongodb-community@5.0
我收到
Error: Formula 'mongodb-community' is not installed.
有什么建议吗?

31moq8wy

31moq8wy1#

我也遇到了同样的情况,但我的问题实际上是这个错误:
致命错误:无法将HEAD解析为修订
使用以下方法求解:

git -C $(brew --repository homebrew/core) checkout master

您还可以:

brew update

brew upgrade

brew upgrade --cask

brew cleanup

然后再次重新启动mongodb社区版安装过程!对我很有效!

ie3xauqp

ie3xauqp2#

我遇到了完全相同的问题(我使用的是MacOC版本11. 5. 1)。
您的brew tap mongodb似乎没有执行任何操作的原因可能是因为您已经点击了mongodb。尝试用brew untap mongodb取消点击,然后用brew tap mongodb/brew重新点击。
建立连接后,尝试使用brew install mongodb-community@5.0再次安装。在此阶段,我无法安装5.0版,因此我安装了4.4版(使用brew install mongodb-community@4.4)。
之后,尝试运行mongo与brew services start mongodb-community@5.0(或brew services start mongodb-community@4.4,如果你已经安装了4. 4版本),它应该工作得很好!
如果您已经安装了4.4版,请确保运行命令PATH="/usr/local/opt/mongodb-community@4.4/bin" mongo来启动mongo shell。

7xzttuei

7xzttuei3#

  1. Check with brew list | grep mongo that mongodb-community, mongodb-database-tools, mongosh exist at your PC. If they do not exist, install them with brew.
  2. Recently also installed mongodb V4.4.5 and can not start it with brew services start mongodb-community . For me works starting it manually as a background process as admin sudo mongod --config /usr/local/etc/mongod.conf --fork
  3. And last call mongo to work with mongoDB shell.
    Reason: directory/file access issue. Not sure.
kwvwclae

kwvwclae4#

我也有同样的问题。这为我解决了它:

git -C $(brew --repository homebrew/core) checkout master

brew update

brew upgrade

brew upgrade --cask

brew cleanup

然后使用以下命令安装Mongodb社区的最新版本:

brew install mongodb-community@6.0

注意:在您阅读本文档时,版本可能已过时

相关问题