zsh compinit: insecure directories, run compaudit for list

After I installed nvm locally, it auto added paths to .bash_profile file. But my default terminal use .zshrc so I copied those path over.

Everytime I fire terminal after above change, terminal auto prompt below warning.

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

When I run compaudit, it prints following:

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

Following are the paths that I copied over:

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

How should I deal with this error? I don't understand why it thinks it's insecure.

1 Answer

I removed those below NPM paths, and it fixed the issue meanwhile.

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like