➜  ~ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-e:77: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040677
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin CODEOFCONDUCT.md etc git lib Library LICENSE.txt munki README.md sbin share .git .github .gitignore
➜  ~ brew install maven
zsh: command not found: brew

当前回答

编辑.zshrc文件:

nano .zshrc

并在文件的开头添加以下内容:

export PATH=/opt/homebrew/bin:$PATH

保存并运行:

source ~/.zshrc 

其他回答

您应该同时将/opt/homebrew/bin和/opt/homebrew/sbin添加到$PATH env中。

导出路径= / opt /组装/ bin: / opt /组装/ sbin: $路径

快捷方式:运行command

echo export PATH=$PATH:/opt/homebrew/bin:/opt/homebrew/sbin >> ~/.zshrc . sh

然后运行酿酒医生检查

在安装时,brew有这个-NEXT STEPS控制台日志,需要包含它到bash的路径。

执行如下步骤:

`echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/YOUR_USER/.zprofile`

`eval "$(/opt/homebrew/bin/brew shellenv)"`

可能会迟到,但肯定会有帮助。你必须首先安装brew。只要运行下面的命令就可以了:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

你的电脑上已经安装了自制软件。你需要像这样修改你的PATH:

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

或者从起始点执行brew:

/usr/local/bin/brew install maven

编辑.zshrc文件:

nano .zshrc

并在文件的开头添加以下内容:

export PATH=/opt/homebrew/bin:$PATH

保存并运行:

source ~/.zshrc