安装了Mac OSX(Apple Silicon)Homebrew,但未找到brew cmd [英] Mac OSX (Apple Silicon) Homebrew installed but brew cmd not found

查看:95
本文介绍了安装了Mac OSX(Apple Silicon)Homebrew,但未找到brew cmd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜寻了我遇到的错误,但是据我所知,这个问题可能与Big Sur/Apple Silicon保存Homebrew的路径与其他Macbook方法有何不同.

I have googled around the error I was experiencing but from what I could tell this issue is likely related to how the path in which Homebrew is saved for Big Sur/Apple Silicon is different than other Macbook approaches.

按照自制"页面上的说明,我运行了 cURL 命令:

Following the instructions on the Homebrew page, I ran the cURL command:

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

但是,在操作成功完成之后,终端中出现了警告:警告:bin/opt/路径不存在

However, after the operation successfully completed, there was a warning in terminal: warning: bin/opt/ path does not exist

当我尝试运行啤酒医生时,找不到命令.

And when I attempted to run a brew doctor the command was not found.

很明显,这是一个路径问题,但是我该如何解决

It's clear there is a pathing issue, but how do I solve it

推荐答案

在这种情况下,我发现这是PATH问题的组合,并且 .zshrc 文件从〜/目录

In this case, I discovered it was a combination of a PATH issue as well as the .zshrc file was missing from the ~/ directory

我可以通过以下步骤解决问题.

I was able to resolve the issue with these steps.

  1. 导航到 cd/opt/homebrew/bin/
  2. 运行 export PATH = $ PATH:/opt/homebrew/bin
  3. 导航回家"目录与 cd〜/
  4. 在此目录中,我发现没有 .zshrc文件(:scream:)
  5. 所以我用 touch .zshrc 创建了一个文件,然后
  6. 运行以下命令: echo export PATH = $ PATH:/opt/homebrew/bin>>.zshrc
  1. Navigate to cd /opt/homebrew/bin/
  2. Run export PATH=$PATH:/opt/homebrew/bin
  3. Navigate back to "home" with cd ~/
  4. in this directory I found that there was no .zshrc file (:scream:)
  5. So I created a file with touch .zshrc and then
  6. ran this command: echo export PATH=$PATH:/opt/homebrew/bin >> .zshrc

运行该命令后,我能够成功使用 brew doctor 和其他相关命令!

And after running that command, I was able to successfully use the brew doctor and other related commands!

这篇关于安装了Mac OSX(Apple Silicon)Homebrew,但未找到brew cmd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆