➜  ~ /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

当前回答

也许不是很明显,但是除了上面的步骤之外,检查您的.zshprofile是否被任何多余的引号损坏。您还应该关闭所有终端实例。

其他回答

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

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

我只是做了echo 'eval ' $(/home/linuxbrew/。linuxbrew / bin /酿造shellenv)' >> ~/。zshrc,因为我正在使用哦-我的zsh。这样做之后应该就可以使用冲泡了。

对于2022年10月6日的最新版本…

==>下一步:

在终端上运行以下三个命令,将Homebrew添加到PATH: echo '#为Homebrew设置路径,MANPATH等。>> /Users/tusharkhatri/.zprofile Echo 'eval "$(/opt/homebrew/bin/brew shellenv)">> /Users/tusharkhatri/.zprofile $(/opt/homebrew/bin/brew shellenv) 运行brew帮助来开始 进一步的文档: https://docs.brew.sh

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

执行如下步骤:

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

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

我在macOS Big Sur(11.0.1)上遇到了类似的问题。在我的例子中,homebrew保存在/opt/homebrew/,而不是/usr/local/....

所以我补充道

导出路径= / opt /组装/ bin:美元的道路

到我的主目录中的.zshrc文件,并且ZSH shell能够找到brew命令。