Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to downgrade Angular CLI version?

I'm new in Angular 4 and I am getting this error,

Your global Angular CLI version (6.0.1) is greater than your local version (1.4.1). The local Angular CLI version is used. 

Can you please help me solving this ?

like image 522
Mukesh Prajapati Avatar asked May 16 '18 06:05

Mukesh Prajapati


People also ask

How do I uninstall Angular CLI globally?

We will use the following command to uninstall Angular CLI like this: npm uninstall -g @angular/cli.

How can I check Angular CLI version?

Use the command ng --version (or ng -v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to find out the globally installed version of Angular.


2 Answers

npm uninstall -g @angular/cli npm cache clean npm install -g @angular/[email protected] 
like image 90
Ritwick Dey Avatar answered Oct 05 '22 17:10

Ritwick Dey


Quick fix :

npm uninstall -g @angular/cli npm cache clean npm install -g @angular/[email protected] 

Explanation :

If you want remove this warning, then you can downgrade your global angular-cli installation to eg. 1.4.1 by running above commands on terminal:

Complete Upgrade and Downgrade guide is on GitHub README.

Your project always uses CLI version on which you have created the project. You can see it in the warning while running ng serve.

If global version is greater than Local version then local version is used.

It is also defined in your package.json file.

"devDependencies": {     "@angular/cli": "1.5.0",      .... }  

CLI warning

Reference Link

like image 43
Sangwin Gawande Avatar answered Oct 05 '22 19:10

Sangwin Gawande