Issue
I don't know if this is an error but every time I do ng serve --open
in my terminal I always received this message:
D:\3rdYR\AppDev\bigProject\public>ng serve --open
This version of CLI is only compatible with Angular versions ^13.0.0,
but Angular version 12.2.5 was found instead.
Please visit the link below to find instructions on how to update Angular.
https://update.angular.io/
I only use angular 12
What I've tried so far
ng --version
npm uninstall -g @angular/cli
npm cache clean --force
npm install -g @angular/cli@12.1.0
ng --version
Just like the answer below, I tried to do npm cache clean --force
but I get this from my terminal:
npm WARN using --force Recommended protections disabled.
I also tried to go to %appdata%
and delete the npm-cache folder and run npm cache clean --force
again, but I still get this:
npm WARN using --force Recommended protections disabled.
and when I tried to ng-serve
it I still get the message (above)
Solution
Do this.
ng --version
npm uninstall -g @angular/cli
npm cache clean --force
npm install -g @angular/cli@12.1.0
ng --version
you can also try installing other versions like 12.2 or the latest 12.* using the above command. For reference, I have mentioned 12.1.0
If you are getting disabled error, do this:
delete it manually: type in windows search - run - %appdata% - delete npm-cache folder Reinstall the node that should fix everything
npm install -g npm@latest
Run above command only after deleting npm-cache folder
Answered By - Aakash Kumar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.