Homebrew是Mac上的软件包管理器
打开Terminal,输入:bash,然后输入如下命令:
/bin/zsh -c "$(curl -fsSL https://gitee.com/huwei1024/HomebrewCN/raw/master/Homebrew.sh)"
安装完成后报错 command not found : brew
检查:
先运行此命令/usr/local/Homebrew/bin/brew -v ,如果是ARM架构的芯片运行/opt/homebrew/bin/brew -v 看是否能出来Homebrew的版本号
因为M1芯片的包安装位置不在是以前的/usr/local/而是/opt/homebrew,所以要将配置文件里的环境变量改过来
解决方法:添加环境变量
export PATH=/opt/homebrew/bin:$PATH
export PATH=/opt/homebrew/sbin:$PATH
然后测试看看:
标签:opt,bin,Homebrew,Mac,M1,PATH,brew,homebrew From: https://blog.51cto.com/helpdesk/6962260