Your global Angular CLI version (6.0.8) is greater than your local version (1.0.2)

42,146

Solution 1

You have the old angular/cli package in your package.json

To update use:

npm r angular-cli
npm i @angular/cli@latest -D

Be aware though, if you have already been using the old cli for a long time, you might have to do some code migration. Especially when it comes to tests, polyfills and the angular config file.

You could try to create an empty angular project using the new cli, and compare the files which are created there, with the files you have in your own project, and update where applicable.

After that, when you have to update your cli again, you can use the new ng update command

Solution 2

You are using new project in older CLI you need to run this commands

npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest
npm install

or you can try this approach

Updating npm :

Run [sudo] npm install -g npm  (sudo  is only required on Mac/ Linux)

Updating the CLI :

[sudo] npm uninstall -g angular-cli @angular/cli 

npm cache clean 

[sudo] npm install -g @angular/cli 
Share:
42,146

Related videos on Youtube

v8-E
Author by

v8-E

I'm in the habit of marking twisty, head-bending sections of code with a comment like: // here be dragons Ideally I'll get back to that section and clean it up, but meanwhile...

Updated on July 23, 2020

Comments

  • v8-E
    v8-E almost 4 years
    C:\dev\myApp> ng serve -o 
    Your global Angular CLI version (6.0.8) is greater than your local version (1.0.2). 
    The local Angular CLI version is used.
    To disable this warning use `"ng config -g cli.warnings.versionMismatch false"`
    

    I don't know what to do with this.

    I tried uninstalling angular/cli and npm cache clean but still have problems.

    Anyone help me !

    • Rachit Shroff
      Rachit Shroff almost 6 years
      This is just a warning. If you want to disbale such warning run this command in your terminal: ng config -g cli.warnings.versionMismatch false
    • baao
      baao almost 6 years
      Depending on the version of angular that you are using, this is not just a warning but will become a problem. @RachitShroff OP is using angular 6, with this config and suppressing the warning he wouldn't even know why his ng update command is failing for example. The correct way to fix this is to edit the package.json, edit @angular/cli's version to one that is supporting angular 6's features
    • Rachit Shroff
      Rachit Shroff almost 6 years
      @baao Agreed. Thanks for the clarification :)
  • Admin
    Admin almost 6 years
    The problem is to run an old project with the old version while I have the latest version installed. I will try .. Thank you for the help
  • Poul Kruijt
    Poul Kruijt almost 6 years
    @takoua in that case, there is no problem. It's just a notice/warning which won't affect anthing