根据Homebrew网站,要安装它,我需要输入:

brew install wget

我得到一个错误消息:

-bash: brew: command not found

找到了这个答案。然而,问题是我在/usr/local/bin中没有看到brew。

我在.bashrc文件中添加了下面这行代码

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

仍然得到命令未找到错误。

如何在macOS上安装Homebrew ?


当前回答

检查是否安装了Xcode:

$ gcc --version

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

$ brew doctor

$ brew update

http://techsharehub.blogspot.com/2013/08/brew-command-not-found.html“点击这里获取准确的指令更新”

其他回答

Brew现在已经用Bash重写了!

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

就在家酿网站主页的顶部。

终端提示符:

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

命令brew install wget演示了如何在已经安装brew之后使用Homebrew安装另一个应用程序(在本例中是wget)。


历史……

在大约2020年之前,Homebrew页面上给出的命令是:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

剧本如下:

- usr/bin/ruby -e“curl -fsSL” https://raw.githubusercontent.com/Homebrew/install/master/install)”

如果运行后仍然报错,

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

然后尝试从https://developer.apple.com/download/more/下载并安装命令行工具,适用于特定的Mac os和Xcode版本。

然后试着跑,

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

然后

brew install node

解决“-bash: brew:命令未找到”问题

将Homebrew添加到/Users//.bash_profile中的PATH:

echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users//.bash_profile . sh

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