When I open the terminal did't do anything. It will shows errors as below.
I had the same error after updating angular every time after opening the terminal.
Depending on which terminal you use either open configuration file which will be saved in ~/.bashrc, or for zshell ~/.zshrc, and so on for others,
Edit the corresponding ~/.bashrc
or ~/.zshrc
file and delete or comment this line:
source <(ng completion script)
Sadly you will lose the angular autocompletion, but it looks like there is some bug causing this in their implementation
According to angular.io, ng completion
will help you in command line mode. So, if you face the problem, you can try to fix it rather than simply remove it. This command works in Angular 14.
First you should try to upgrade your @angular/cli
by below commands:
npm uninstall @angular/cli
npm i --location=global @angular/cli
After this, you should try to open a new terminal, see if the problem still exists.
If yes, then probably you used a wrong ng
, by running command which ng
, it will tell you the "global" ng
location. Almost 100 percent it is not the one you have just installed.
So you can just delete this ng
and it's related node_modules/@angular
, then re-install angular cli.
It should work now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With