bashnpmcommandzshoh-my-zsh

zsh: command not found: ng


I have setup my angular project in bash terminal(default one). Command like

ng s

It worked fine.

Now I change my default terminal to zsh. On running command

ng serve 

throws error:

zsh: command not found: ng

It work fine if I switch my new default-terminal(zsh) to bash; again to zsh. I think zsh does not understand the packages installed in bash initially

How to fix this command not found issue?


Solution

  • Possibly, on startup bash adds ng location to PATH, but zsh doesn't. You can check ~/.bashrc and ~/.bashprofile to see what is added to the PATH variable (all lines starting with export...), and copy these lines to ~/.zshrc file.