Skip to content

Error serving one of the examples. No NgModule metadata found for 'AppModule' #1

@minicatsCB

Description

@minicatsCB

Hi!

Summary
I just want to run the example in /angular-sample-code/12.routing/6.router-guards but after installing the dependencies and executing the command ng serve I receive the error No NgModule metadata found for 'AppModule'.

Steps to reproduce

  1. Download the repo at https://github.com/codecraft-tv/angular-sample-code.
  2. Go to the below directory: /angular-sample-code/12.routing/6.router-guards.
  3. Execute npm install.
  4. Execute ng serve.

What is the current bug behavior?
After the last of the steps, I receive this error:
No NgModule metadata found for 'AppModule'
and the application can not be correctly served.

What is the expected correct behavior?
Correctly serve the application.

Relevant logs and/or screenshots
This is the complete output of the command ng serve.

Your global Angular CLI version (8.3.12) is greater than your local
version (6.0.8). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
 10% building modules 6/6 modules 0 activeℹ 「wds」: Project is running at http://localhost:4200/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: 404s will fallback to //index.html
                                                                                          
Date: 2020-01-17T12:02:05.553Z
Hash: cb595c67827afba0e932
Time: 2424ms
chunk {main} main.js, main.js.map (main) 355 kB [entry] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 354 kB [entry] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.22 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 464 kB [entry] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 5.5 kB [initial] [rendered]

ERROR in No NgModule metadata found for 'AppModule'.
ℹ 「wdm」: Failed to compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions