0

I am new to coding and using the terminal, but after installing Angular, this keeps popping 3 times on my hyper terminal, even after i was told to to do this :

to fix that, in your terminal type: code .zshrc

comment the following lines from the file:

# Load Angular CLI autocompletion.
source <(ng completion script)

none of this worked, please i really need help, someone explain to me what to do, and please explain in a way that a small kid would understand, thank you so much in advance

Peregrino69
  • 2,337
  • 1
  • 15
  • 22
  • 1
    Does this answer your question? [zsh: command not found: {compinstall,compinit,compdef}](https://unix.stackexchange.com/questions/339954/zsh-command-not-found-compinstall-compinit-compdef) – Zac Anger Apr 09 '23 at 02:47
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Apr 13 '23 at 13:01

1 Answers1

1

"commenting a line" means to change it so it's taken as a comment in the language, so it is ignored. You could also delete it altogether. But changing it to a comment keeps it in there in case later on you want to uncomment it.

In shells, comments are prefixed with a # character. So commenting the

source <(ng completion script)

line means changing it to:

# source <(ng completion script)

That means however that that line which sounds like it's meant to configure completion for some software will not be run.

So instead, you can instead fix it so it works properly.

You'll want to double check the instructions for the software that asked you do add those lines if you haven't missed some step.

Here, it seems that thing expects compinit (which defines the compdef function among other things) has been run beforehand.

Maybe the call to compinit is further down in your ~/.zshrc, in which case you'll want to move that line below it, like at the end of your ~/.zshrc.

Or maybe it expects you to have enabled some third-party plugin system for zsh such as oh-my-zsh, or to have run compinstall, etc.

To run compinstall (to configure completion), run:

autoload compinstall
compinstall

That will add lines to ~/.zshrc including compinit. You'll still need to move that source... line below those added lines.

Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501