sudo brew install mongodb报错

时间:2024-08-26 19:05:41

报错信息如下:

Error: Running Homebrew as root is extremely dangerous and no longer supported. As Homebrew does not drop privileges on installation you would be giving all build scripts full access to your system.
解决方法:

命令:sudo chown -R 用户名 /usr/local

再次报错:chown: /usr/local: Operation not permitted

在High Sierra版本中已经不能这么使用了,应该这么使用:

sudo chown -R $(whoami) $(brew --prefix)/*

brew install mongodb