【问题标题】:How to make MacOS recognize previously installed packages because `/usr/local/lib` and `/usr/local/include` are deleted?由于 `/usr/local/lib` 和 `/usr/local/include` 被删除,如何让 MacOS 识别以前安装的软件包?
【发布时间】:2019-05-27 12:36:29
【问题描述】:

由于一些问题,我很累时试图卸载我的 node.js。接下来我知道...我在 Mac Mojave 中不小心删除了 2 个文件夹 /usr/local/lib/usr/local/include

我重新安装了操作系统。令我惊讶的是,我所有的个人文件都保留了下来,homebrewnpm 安装的文件也保留了下来。我注意到之前安装的 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


    【解决方案1】:

    我过去不小心删除了 /usr/local 的东西。为了让 brew 的东西回来,我使用了brew reinstall $(brew list)

    注意:python@3:由于权限冲突,我必须在发出重新安装命令之前brew remove --force --ignore-dependencies python@3

    【讨论】:

      猜你喜欢
      • 2020-10-27
      • 2017-06-05
      • 2014-07-17
      • 1970-01-01
      • 1970-01-01
      • 2015-07-05
      • 2013-08-13
      • 2015-05-06
      • 2012-06-06
      相关资源
      最近更新 更多