【发布时间】:2019-05-27 12:36:29
【问题描述】:
由于一些问题,我很累时试图卸载我的 node.js。接下来我知道...我在 Mac Mojave 中不小心删除了 2 个文件夹 /usr/local/lib 和 /usr/local/include!
我重新安装了操作系统。令我惊讶的是,我所有的个人文件都保留了下来,homebrew 和 npm 安装的文件也保留了下来。我注意到之前安装的 npm 包是可用的,但是我需要按照 intermianl 建议的命令重新链接它们。到目前为止一切顺利。
但是,对于 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
【问题讨论】:
标签: node.js mongodb macos homebrew