What does it mean and how can I fix it?
zsh compinit: insecure directories, run compaudit for list.
Ignore insecure directories and continue [y] or abort compini
On macOS Sierra you need to run:
sudo chown -R $(whoami):staff /usr/local
running this command worked for me on my mac OS Catalina
:
compaudit | xargs chmod g-w,o-w
These two lines have fixed for me.
sudo chown -R _user_:root /usr/local/share/zsh
sudo chown -R _user_:root /usr/local/share/zsh/*
None of the solutions listed worked for me. Instead, I ended up uninstalling and reinstalling Homebrew, which did the trick. Uninstall instructions may be found here: http://osxdaily.com/2018/08/12/how-uninstall-homebrew-mac/
My suggestion would be to run compaudit and then just fix permissions on the directories found by the audit. Make sure the identified directories do not have write permissions for group or other.
run compaudit
and it will give you a list of directories it thinks are insecure
sudo chown -R username:root target_directory
sudo chmod -R 755 target_directory