惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Palo Alto Networks Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Schneier on Security
Engineering at Meta
Engineering at Meta
I
InfoQ
L
LangChain Blog
Cyberwarzone
Cyberwarzone
T
Tenable Blog
WordPress大学
WordPress大学
P
Privacy & Cybersecurity Law Blog
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Jina AI
Jina AI
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
Know Your Adversary
Know Your Adversary
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Last Watchdog
The Last Watchdog
Last Week in AI
Last Week in AI
Cloudbric
Cloudbric
S
SegmentFault 最新的问题
爱范儿
爱范儿
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 叶小钗
AI
AI
T
Tor Project blog
I
Intezer
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
N
News and Events Feed by Topic
Latest news
Latest news
S
Security Affairs
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog RSS Feed
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
S
Securelist

博客园 - 君临天下之徐少

nvm安装 Less的优点 什么是nrm js 处理大数相减 React函数式组件值之useRef()和useImperativeHandle() 谷歌刷题插件安装 SSL certificate problem: unable to get local issuer certificate 错误解决 常用命令 Mac安装Nvm Node开发环境 解决Mac安装Homebrew失败 Canvas学习:globalCompositeOperation详解 React.CreateContext html让容器居中,css让容器水平垂直居中的7种方式 js下载文件防止白屏 GitHub上README.md编写教程(基本语法) 微信字体大小调整导致的H5页面错乱问题处理 G6-Editor 编辑器入门使用教程 git reset 加不加 --hard的区别 taro, h5拨打电话和发送短信
Homebrew 安装
君临天下之徐少 · 2026-04-02 · via 博客园 - 君临天下之徐少

当你在 macOS 终端中遇到“command not found: brew”的错误时,通常意味着 Homebrew 没有正确安装或者其可执行文件没有被添加到系统的 PATH 环境变量中。以下是解决这个问题的几个步骤:

1. 确认 Homebrew 是否已经安装

首先,你可以尝试重新安装 Homebrew。在终端中运行以下命令来检查 Homebrew 是否已经安装:

如果这个命令返回了 Homebrew 的版本号,说明 Homebrew 已经安装。如果返回错误,说明需要安装或重新安装。

2. 安装 Homebrew

如果你发现 Homebrew 没有安装,可以通过 Ruby 的官方安装脚本安装:

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

3. 确认 PATH 环境变量

如果 Homebrew 已经安装,但仍然出现“command not found: brew”的错误,可能是因为 Homebrew 的可执行文件路径没有被加入到 PATH 环境变量中。你可以通过以下命令来添加:

echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc # 如果你使用的是 zsh echo 'export PATH="/usr/local/bin:$PATH"' >> ~/.bash_profile

然后,重新加载配置文件:

source ~/.zshrc # 如果你使用的是 zsh source ~/.bash_profile # 如果你使用的是 bash

4. 检查 Homebrew 的安装路径

有时候,Homebrew 可能被安装在非标准路径。你可以使用 find 命令来搜索 Homebrew 的可执行文件:

find / -name brew 2>/dev/null

找到正确的路径后,确保这个路径已经添加到你的 PATH 环境变量中。

5. 使用绝对路径运行 Homebrew

作为临时解决方案,你可以直接使用 Homebrew 的绝对路径来运行命令:

/opt/homebrew/bin/brew install <package>

或者根据你的实际安装路径调整上面的命令。

通过上述步骤,你应该能够解决“command not found: brew”的问题。如果问题仍然存在,可能需要检查是否有其他系统配置问题或者权限问题。