zsh: command not found: brew
刚入手macbook pro M1在官网运行brew安装命令后,依然找不到brew命令,需要查看下是否有下面两个环境变量的导出 运行
vim ~/.zshrc
检查根目录.zshrc中是否有(表示homebrew安装位置)
export PATH=$HOME/bin:/usr/local/bin:$PATH
export PATH="/opt/homebrew/bin:$PATH"
可以用echo 添加上导出语句,
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> $HOME/.zshrc
也可以用
vi ~/.zshrc
然后运行source命令,执行生效
source ~/.zshrc