首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在加载时在iterm2上输出隐秘错误

在加载时在iterm2上输出隐秘错误
EN

Stack Overflow用户
提问于 2022-01-31 07:15:45
回答 2查看 374关注 0票数 0

我是OSX10.15.7 (Catalina)的Mac用户。我最近更新了brew,并用它升级了公式。从那时起,我的终端变得异常,并打印出以下错误:

代码语言:javascript
复制
_zulu_init_setup_completion:9: compinit: function definition file not found
/user/path/.zulu/packages/tipz/tipz.zsh:86: add-zsh-hook: function definition file not found
_zulu_init:48: promptinit: function definition file not found
_zulu_init:50: command not found: prompt
/user/path/.zprezto/init.zsh:14: is-at-least: function definition file not found
prezto: old shell detected, minimum required: 4.3.17
/user/path/.zshrc:19: promptinit: function definition file not found
/usr/local/Cellar/zplug/2.4.2/autoload/init.zsh:16: colors: function definition file not found
polling.zsh:17: add-zsh-hook: function definition file not found
# the following line is repeated at least 20 times
__zplug::core::core::get_interfaces:49: regexp-replace: function definition file not found
__zplug::core::core::prepare:67: compinit: function definition file not found
[zplug] ERROR: The loading of zplug was discontinued.
/user/path/.nvm/bash_completion:87: bashcompinit: function definition file not found
/user/path/.nvm/bash_completion:88: compinit: function definition file not found
/user/path/.nvm/bash_completion:95: command not found: complete
/user/path/.zshrc:35: command not found: gcloud
/user/path/google-cloud-sdk/completion.zsh.inc:1: bashcompinit: function definition file not found
/user/path/google-cloud-sdk/completion.zsh.inc:4: compinit: function definition file not found
/user/path/google-cloud-sdk/completion.zsh.inc:37: command not found: complete
/user/path/google-cloud-sdk/completion.zsh.inc:62: command not found: complete
/user/path/google-cloud-sdk/completion.zsh.inc:63: command not found: complete

我对bash不太熟悉,我认为我的安装可能也是复杂的(噢-zsh,prezto,powerlevel10k)。我只想知道如何清除错误并修复这个错误。

我的zshrc看起来如下

代码语言:javascript
复制
#
# Executes commands at the start of an interactive session.
#
# Authors:
#   Sorin Ionescu <sorin.ionescu@gmail.com>
#
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" 
# Initialise zulu plugin manager
source "${ZULU_DIR:-"${ZDOTDIR:-$HOME}/.zulu"}/core/zulu"
zulu init

# Source Prezto.
if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
  source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
fi

# Customize to your needs...
autoload -Uz promptinit
promptinit
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
# export PATH="$PATH:$HOME/.rvm/rubies/ruby-2.4.1/bin/"

# loading ZPLUG
export ZPLUG_HOME=/usr/local/opt/zplug
source $ZPLUG_HOME/init.zsh

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:/user/path/Library/Python/3.7/bin:$PATH"
export GOOGLE_PROJECT="$(gcloud config get-value project)"
export GOOGLE_APPLICATION_CREDENTIALS="/user/path/PROJECTS/personal/k8s/gcp-k8s-credentials.json"

# The next line updates PATH for the Google Cloud SDK.
if [ -f '/user/path/google-cloud-sdk/path.zsh.inc' ]; then . '/user/path/google-cloud-sdk/path.zsh.inc'; fi

# The next line enables shell command completion for gcloud.
if [ -f '/user/path/google-cloud-sdk/completion.zsh.inc' ]; then . '/user/path/google-cloud-sdk/completion.zsh.inc'; fi

# iziwork key
export GITHUB_AUTH_TOKEN=xxx

编辑

Bash版本:echo $BASH_VERSION给出了一个空行。

Zsh版本: 5.7.1

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-02-20 09:12:14

最后出现了几个问题,在brew升级之后,.zshrc文件中的某些路径没有得到正确的升级:

.../zsh/function)

  • path
  • fpath在~/..config/zulu中指向较早版本或错误版本的zsh (特别是zplug的
    • fpath是不正确的
    • ,在将路径设置为gcloud

    之前调用的gcloud命令)。

所以

代码语言:javascript
复制
#this
/usr/local/Cellar/zsh/5.8/share/zsh/functions
#became 
/usr/local/Cellar/zsh/5.8_1/share/zsh/functions

代码语言:javascript
复制
#this 
export ZPLUG_HOME=/usr/local/Cellar/zplug/2.4.2/autoload/zplug
#became this
export ZPLUG_HOME=/usr/local/Cellar/zplug/2.4.2
票数 0
EN

Stack Overflow用户

发布于 2022-01-31 22:17:44

prezto:检测到旧外壳,最低要求: 4.3.17

检查您的zsh版本

代码语言:javascript
复制
zsh --version
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70922349

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档