简体   繁体   中英

Your global Angular CLI version (10.2.0) is greater than your local version (10.0.8). The local Angular CLI version is used

Your global Angular CLI version (10.2.0) is greater than your local version (10.0.8). 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.

It just means that you have installed the Angular CLI globally and locally (once using npm install -g and once using just npm install . That your project would use the locally installed version makes sense to me, since in all other cases it would presumably use the globally installed version.

But unless specific (and unusual) requirements require it, the CLI isn't really something that will change depending on the project. So I'd keep only the globally installed version and uninstall the locally installed one. (I'm doubtful the ng command would even work if the CLI installed only locally, but I might be wrong about that.)

If others work on the project and require the CLI, add an entry to your Readme instructing them to install the Angular CLI globally. If, however, you require that everyone use the same CLI version, and a local installation of the CLI does enable the ng command, then you can also only keep the local one and uninstall the global one. Either way, you won't need both. It just depends on your specific circumstances which way to go.

Many people avoid to install npm globally. You can uninstall angular cli from globally

  • npm uninstall -g @angular/cli

Then you can ng command dont work, But dont panic.

You can do the same thing by:

  • npm run ng -- serve
  • npm run ng -- build

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM