在MacOS Big Sur(M1芯片)上安装自制软件时收到警告 [英] Getting a warning when installing homebrew on MacOS Big Sur (M1 chip)
问题描述
有人在安装自制软件时看到此警告吗?这是什么意思?我应该担心吗?
Has anyone seen this warning while installing homebrew? What does it mean? Should I be worried?
警告:/opt/homebrew/bin不在您的PATH中.
Warning: /opt/homebrew/bin is not in your PATH.
一些背景信息:
我阅读了一些有关M1芯片的博客,并认为我需要在Mac上安装Rosetta 2才能安装自制软件.
I read some blogs about M1 chip and thought I would need to install Rosetta 2 on my mac in order to install homebrew.
但是,在我发行Rosetta 2之前,我尝试安装普通的旧/bin/bash -c" $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)".
.经过检查,我看到安装成功!"
However, before I Rosetta 2, I tried installing the plain old /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
. The went through, and I saw "Installation successful!"
唯一的问题是我看到了以下警告.
The only issue is that I saw the following waring.
homebrew警告:/opt/homebrew/bin不在您的PATH中.
homebrew Warning: /opt/homebrew/bin is not in your PATH.
我应该担心吗?是什么意思?
Should I be worried? What does it mean?
推荐答案
我今天在Mac OS Big Sur(带有M1芯片)上遇到了同样的问题.警告中指出了该问题:警告:/opt/homebrew/bin不在您的PATH中.
似乎这是hombrew二进制文件所在的目录.要解决此问题,您可以执行以下操作:
I had the same issue today, on Mac OS Big Sur (with M1 chip).
The problem is indicated in the warning : Warning: /opt/homebrew/bin is not in your PATH.
It seems that it is the directory where the binaries of hombrew are put.
To resolve, you can do :
- 使用文件末尾的〜/.zshrc或〜/.bashrc
export PATH=/opt/homebrew/bin:$PATH
然后,在终端中点击 source〜/.zshrc
或重新启动它.
After this, tap source ~/.zshrc
in your terminal or restart it.
有关带有M1芯片的Mac上Homebrew当前状态的更多信息: Homebrew中的Apple Silicon支持
For more infos about the current status of Homebrew on Mac with a M1 chip : Apple Silicon support in Homebrew
正如@kangkyu在此正式支持Apple Silicon .如果您使用的是先前版本,只需 brew update
.
Edit :
As mentioned by @kangkyu in this comment, Homebrew is changing to version 3.0.0 which supports officially Apple Silicon. If you have a prior version just brew update
.
这篇关于在MacOS Big Sur(M1芯片)上安装自制软件时收到警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!