问题:
使用brew命令时报错:-bash: brew: command not found
解决方案
方案1、在用户名的隐藏文件 .bash_profile 中添加命令行
export PATH=/usr/local/bin:$PATH
保存退出后,再运行以下命令使之生效
source .bash_profile
如果还不能生效,需要重新安装homebrew
方案2、重新安装homebrew
1、使用新命令安装整个homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
/bin/zsh -c"$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
/usr/bin/ruby -e "$(curl -fsSL https://cdn.jsdelivr.net/gh/ineo6/homebrew-install/install)"


检查brew命令可以使用
brew help

网友评论