由于某些问题,我正尝试卸载我的node.js,当时我很累。我知道的下一件事...我不小心删除了Mac Mojave中的两个文件夹/usr/local/lib
和/usr/local/include
!
我重新安装了操作系统。令我惊讶的是,我所有的个人文件都保留了,homebrew
和npm
安装的文件也保留了下来。我注意到的是,以前安装的npm软件包可用,但是我需要按照intertermianl建议的命令重新链接它们。到目前为止一切顺利。
但是,mongodb可能并非如此。我运行mongo
时遇到错误:-bash: mongod: command not found
。我的问题:如何使我的系统识别mongo?
以下是步骤的再现:
$ brew install mongodb-community@4.0
Warning: mongodb/brew/mongodb-community 4.0.9 is already installed and up-to-date
To reinstall 4.0.9, run `brew reinstall mongodb-community`
$ brew services start mongodb-community@4.0
Service `mongodb-community` already started, use `brew services restart mongodb-community` to restart.
$ brew services restart mongodb-community@4.0
Stopping `mongodb-community`... (might take a while)
==> Successfully stopped `mongodb-community` (label: homebrew.mxcl.mongodb-community)
==> Successfully started `mongodb-community` (label: homebrew.mxcl.mongodb-community)
$ mongo
-bash: mongo: command not found
答案 0 :(得分:1)
我过去不小心删除了/ usr / local内容。为了找回酿造的东西,我用了brew reinstall $(brew list)
注意:python @ 3:由于权限冲突,在发出重新安装命令之前,我必须brew remove --force --ignore-dependencies python@3
。