The reason is that root does not have permission to modify the rwx and the permissions of the master and group in this directory of /usr/local
Similar problem: brew install on the mac command line fails, prompting that there is no w permission to the /usr/local directory
操作如下:
1 重启电脑
按住Command + R,进入到恢复界面
打开Terminal终端,然后进入到命令行下
csrutil disable
reboot
2 进入到正常界面:
sudo chown -R $(whoami) /usr/local
成功后 重启电脑 按住Command + R,进入到恢复界面
csrutil enable
3 修改后重启