在 Mac 上打开终端时出现错误消息

在 Mac 上打开终端时出现错误消息

我最近开始使用终端来尝试安装 homebrew。安装 homebrew 后,我遇到了一个问题,每次打开终端时,它都会给我一长串错误消息,详细信息如下(这里只是其中的第一部分)。

Last login: Mon Aug 15 10:25:20 on ttys003
Error: Unknown command: sllenv
-bash: Example: command not found
-bash: /REGEX/: No such file or directory
-bash: CASK...]: command not found
Error: No available formula with the name "[formula"
Error: Broken pipe
-bash: CASK...: command not found
Running brew update --auto-update'...
==› Auto-updated Homebrew!
==› Updated Homebrew from c7df26fed to 5047d4249.
Updated 1 tap (homebrew/core).

Warning: No available formula with the name "formula". Did you mean foreman?
Error: Broken pipe
Already up-to-date.
-bash: CASK...]: command not found
Error: No available formula with the name "[formula".
-bash: CASK...:
command not found
Error: No available formula with the name "formula". Did you mean foreman?
-bash: CASK...]: command not found
Error: No available formula with the name "[formula".
-bash: Troubleshooting:: command not found
HOMEBREW_VERSION: 3.5.9-108-95047d42
ORIGIN: https://github.com/Homebrew/brew
HEAD: 5047d4249e938d448ce8c80641beb4d42e90dbad

然后,它给我一个关于自制软件的很长的概要,并结束我的终端。

我认为导致此问题的原因是我在安装 homebrew 时输入了错误。安装 homebrew 后,它会提示您输入两个命令以将 homebrew 移至 PATH。

==› Next steps:
   Run these two commands in your terminal to add Homebrew to your PATH:
      echo "eval "$(/opt/homebrew/bin/brew shellenv)" >> /Users/milo/.profile
      eval"$(/opt/homebrew/bin/brew shellenv)"
   Run brew help to get started
   Further documentation :
       https://docs.brew.sh

但是,当我第一次输入第一个命令时,它错误地将“shellenv”复制为“sllenv”。不确定这是否相关,但正如您所见,不断弹出的第一个错误是“未知命令:sllenv”

所以每次我打开终端时,它都会给我一长串错误消息,需要一分钟时间,然后终端就会结束。有什么办法可以解决这个问题吗?谢谢

相关内容