这一步是选择‘homeBrew’的国内镜像源。‘homeBrew’源在国外,有的时候网络有限制没法安装成功,所以老师们找了国内的一些镜像源来替代。但是这些镜像源并不稳定,随时都会变动,也不保证能安装成功。所以只能让同学试试,看能否使用。
同学这里既然安装不了,尝试不用homebrew安装mongodb,步骤如下:
1、在官网下载mongodb
https://www.mongodb.com/try/download/community
选择4.0.27版本下载:

如果没有4.0.27版本,安装如下版本:

2、然后按照下面链接中的流程逐步执行
https://www.jianshu.com/p/a594e6482e5c
(1)将下载的压缩包解压,重命名为mongoDB,然后放入/usr/local文件夹下
(2)配置环境变量

例如老师添加到这里:

配置好后,按Command+S保存,关闭文件,执行下面命令:
再输入mongod -version查看是否安装成功(如果打印不出版本号,可以多执行几次source .bash_profile命令)

如果这种方式还不行,那么就只能升级系统了。在高版本的系统中,安装视频重新安装homebrew。
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星