1

When running ng serve I get this warning Your global Angular CLI version (12.0.5) is greater than your local version (1.5.0). The local Angular CLI version is used.

In order to upgrade the local Cli I've tried some steps but every time ng serve doesn't work Error: No projects support the 'serve' target.

these are the steps I've tried to upgrade

first try:

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

second try:

# Install npm-check-updates
$ npm i -g npm-check-updates
# Run npm-check-updates with -u, will upgrade package.json
$ ncu -u
# Install updated packages
$ npm install
sirH
  • 83
  • 5
  • Are you running the update in the root directory of your project? `npm install --save-dev @angular/cli@latest` should work. – Alex Jun 23 '21 at 14:14
  • project directory – sirH Jun 23 '21 at 14:17
  • I think it would be better to change your global to be the same version as your local. I think version 1.5.0 is Angular 4 or 5 and there is no guarantee that Angular CLI version 12 will work properly with it so that's why I think it's best that your global matches your local and that message is just a warning, it will use your local. – AliF50 Jun 23 '21 at 14:25
  • yes it's angular 5 but changing the global CLI will affect other projects – sirH Jun 23 '21 at 14:34
  • did you solve this problem by any chance ? i am facing the same – SGN Nov 19 '21 at 10:44

0 Answers0