我是OSX10.15.7 (Catalina)的Mac用户。我最近更新了brew,并用它升级了公式。从那时起,我的终端变得异常,并打印出以下错误:
_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看起来如下
#
# 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
发布于 2022-02-20 09:12:14
最后出现了几个问题,在brew升级之后,.zshrc文件中的某些路径没有得到正确的升级:
.../zsh/function)
之前调用的gcloud命令)。
所以
#this
/usr/local/Cellar/zsh/5.8/share/zsh/functions
#became
/usr/local/Cellar/zsh/5.8_1/share/zsh/functions和
#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发布于 2022-01-31 22:17:44
prezto:检测到旧外壳,最低要求: 4.3.17
检查您的zsh版本
zsh --versionhttps://stackoverflow.com/questions/70922349
复制相似问题