Angular 2 : No NgModule metadata found Angular 2 : No NgModule metadata found angular angular

Angular 2 : No NgModule metadata found


I had this error even though I had everything that the answers above suggested in place. A simple edit in the app.module.ts file ( like delete a bracket and put it back) did the trick.


The problem is in your main.ts file.

const platform = platformBrowserDynamic();platform.bootstrapModule(App);

You are trying to bootstrap App, which is not a real module.Delete these two lines and replace with the following line:

platformBrowserDynamic().bootstrapModule(AppModule);

and it will fix your error.


Try to remove node_modulesrm -rf node_modules and package-lock.json rm -rf package-lock.json,after that run npm install.