MacOS 终端问题

MacOS 终端问题

我尝试为 mac os 安装 hombrew,在添加到路径时遇到一些问题,现在终端欢迎我显示此消息,我该如何修复它?

.zprofile:export:4: not valid in this context: export HOMEBREW_PREFIX
.zshrc:export:1: not valid in this context: Support/JetBrains/Toolbox/scripts

.z配置文件:

# Added by Toolbox App
export PATH="$PATH:/Users/randus/Library/Application Support/JetBrains/Toolbox/scripts"eval "$(/opt/homebrew/bin/brew shellenv)"
eval "$(/opt/homebrew/bin/brew shellenv)"

.zshrc:

export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/randus/Library/Application Support/JetBrains/Toolbox/scripts

答案1

之间留有空格

export PATH="$PATH:/Users/randus/Library/Application Support/JetBrains/Toolbox/scripts"

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

脚步:

  • nano /Users/randus/.zprofile
  • 在之后添加空格scripts",所以最后你的zprofile内容应该看起来像
    export PATH="$PATH:/Users/randus/Library/Application Support/JetBrains/Toolbox/scripts" eval "$(/opt/homebrew/bin/brew shellenv)"
    
  • Control+O
  • Enter
  • Control+X
  • 重启终端

相关内容