title: Cannot find module './app/server.app.module.ngfactory'
body: <p>I get the following error while building Angular aot :</p>
  
  <p>Cannot find module './app/server.app.module.ngfactory'</p>
  
  <p>Can you help to determine what might be wrong?</p>
  
  <p>main.server.aot.ts that contains the following :</p>
  
  <pre><code>import 'zone.js/dist/zone-node';
  import 'reflect-metadata';
  import 'rxjs/Rx';
  import * as express from 'express';
  import { ngExpressEngine } from '@nguniversal/express-engine';
  import { enableProdMode } from '@angular/core';
  import { ServerAppModuleNgFactory } from './ngfactory/app/server-app.module.ngfactory';
  
  enableProdMode();
  const app = express();
  
  app.engine('html', ngExpressEngine({
    bootstrap: ServerAppModuleNgFactory
  }));
  
  require('./main.server.shared').confApp(app);
  </code></pre>
  
  <p>this is tsconfig.server.aot</p>
  
  <pre><code>{
    "extends": "./tsconfig.server.json",
    "angularCompilerOptions": {
      "genDir": "ngfactory",
      "entryModule": "./app/server-app.module#ServerAppModule"
    },
    "include": [
      "main.server.aot.ts"
    ]
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ZfTNE.png" rel="nofollow noreferrer">project files</a></p>