完美解决Error: Running Homebrew as root is extremely dangerous and no longer supported.

在macOS High Sierra(10.13.6)及以上版本的Mac上面,使用brew install安装时老是报错,因为苹果已经不允许Homebrew作为根来安装了。
详细提示:

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.

所以在新版本的Mac电脑上面使用brew命令安装老是报错。
比如:
你使用brew install kompose安装时提示:权限不足

Error: Permission denied @ apply2files - /usr/local/lib/node_modules/hexo/node_modules/_micromatch@3.1.10@micromatch/lib/.DS_Store

当你添加sudo brew install kompose安装时提示:危险操作。

网上很多做法是把/usr/local路径改成当前用户路径,但是在高版本的Mac上面已经不允许了:

sudo chown -R $(whoami) /usr/local
chown: /usr/local: Operation not permitted

解决方案

执行下面的命令:

$ sudo chown -R `whoami` /usr/local/Homebrew/
$ sudo chown -R $(whoami) $(brew --prefix)/*
$ sudo mkdir /usr/local/Frameworks
$ sudo chown -R `whoami` /usr/local/Frameworks/

之后,再执行brew install kompose就可以安装啦!!!
在这里插入图片描述

评论 27
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值