Home > Software design >  An unhandled exception occurred: The target entry-point "@angular/material/menu"
An unhandled exception occurred: The target entry-point "@angular/material/menu"

Time:02-08

I am new to angular.After reaching to clientapp folder of my project,I have used command called 'ng serve'. I am getting an error. Your global Angular CLI version (12.2.9) is greater than your local version (11.2.18). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".(Yellow color msg) An unhandled exception occurred: The target entry-point "@angular/material/menu" has missing dependencies:

  • @angular/cdk/a11y
  • @angular/cdk/coercion
  • @angular/cdk/keycodes
  • @angular/cdk/portal
  • @angular/cdk/bidi
  • @angular/cdk/overlay
  • @angular/cdk/platform
  • @angular/cdk/scrolling (in red color). So again I have used npm install command and ng serve.Still getting this error.

What shall I do now?

CodePudding user response:

Your global Angular CLI version (12.2.9) is greater than your local version (11.2.18). The local Angular CLI version is used.

Angular cli is producing this warning because your project is build with 11.2.18 while your globally installed version is 12.2.9. You can ignore this warning because your project will use locally installed 11.2.18 version present in node-modules folder.

An unhandled exception occurred: The target entry-point "@angular/material/menu" has missing dependencies:

You are getting this error because some of the modules of @angular/material internally depend on @angular/cdk package.

Try installing @angular/cdk package with:

npm install --save @angular/cdk

If the error still persists, force clean the cache & delete node-modules folder.

npm cache clear --force

After this, run the npm install command. It will download all your project dependencies again.

  •  Tags:  
  • Related