0

Opened up a brand new project, changed absolutly nothing, and when I serve the project I get the following error:

Error: node_modules/@angular/platform-browser/platform-browser.d.ts:44:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule 
class.

This likely means that the library (@angular/platform-browser) which declares BrowserModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

44 export declare class BrowserModule {
---------------------------------------------------------------------------------------------------------

things that I have tried that don't work:

  • re-installing npm
  • rolling npm back to an earlier version
  • opting out of ivy (enableivy=false and aot=false)
  • serve --prod
  • serve again and again

Is there a doctor in the house?!

Newsha Nik
  • 806
  • 2
  • 12
  • 29
  • Does this answer your question? [error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class](https://stackoverflow.com/questions/60290309/error-ng6002-appears-in-the-ngmodule-imports-of-appmodule-but-could-not-be-res) – Roy Jan 19 '21 at 14:31
  • May be restart the console and type ng serve again – Devang Patel Jan 19 '21 at 14:32

1 Answers1

0

Today I have faced the same issue, I tried different ways, changings one of the directory's names of one of the parent directory' of where the file is in had a "#" Sign in its name, which has being causing the issue.

Umar Uzman
  • 71
  • 1
  • 1
  • 6