brew: command not found 修复 mac

时间:2022-09-19 08:03:14

之前就安装过brew,然后家庭突然要用结果说

-bash: brew: command not found

然后在桌面版的Cakebrew里面也显示brew未安装…那我就重新安一下吧
安装很顺利不过有个警告

Warning: /usr/local/bin is not in your PATH.
==> Installation successful!

看了一下我的/usr/local/bin目录没问题啊…里面也有brew
然后用终端启动依然报错,才意识到有点问题。

-bash: brew: command not found

解决办法:更改bash配置文件(主目录中的.bashrc或.profile),并添加以下行

export PATH=/usr/local/bin:$PATH

感谢:http://*.com/questions/14288682/error-installing-homebrew-brew-command-not-found