这意味着什么?我该如何解决?

zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compinit [n]?

运行compaudit将返回如下结果:

There are insecure directories:
/usr/local/share/zsh/site-functions

当前回答

上面列出的解决方案没有一个对我有效。相反,我最终卸载并重新安装了Homebrew,这很管用。卸载说明可以在这里找到:http://osxdaily.com/2018/08/12/how-uninstall-homebrew-mac/

其他回答

上面列出的解决方案没有一个对我有效。相反,我最终卸载并重新安装了Homebrew,这很管用。卸载说明可以在这里找到:http://osxdaily.com/2018/08/12/how-uninstall-homebrew-mac/

这是我在https://github.com/zsh-users/zsh-completions/issues/433#issuecomment-600582607上唯一有用的东西。感谢https://github.com/malaquiasdev !

  $ cd /usr/local/share/
  $ sudo chmod -R 755 zsh
  $ sudo chown -R root:staff zsh

删除组写权限

compaudit | xargs chmod g-w

会成功的。

参见http://www.wezm.net/technical/2008/09/zsh-cygwin-and-insecure-directories/

在我的mac OS Catalina上运行这个命令是有效的:

Compaudit | xargs chmod g-w,o-w

当我sudo -i启动根shell时,我得到了相同的警告,@chakrit的解决方案对我不起作用。

但我发现-u开关的compinit工作,例如在你的.zshrc/zshenv或你调用compinit的地方

compinit -u

注意:不建议用于生产系统

参见http://zsh.sourceforge.net/Doc/Release/Completion-System.html#Initialization