title: PWA support in Angular throws node_modules/@angular/service-worker/service-worker.d.ts, found version 4, expected 3 error
body: <p>I am integrating PWA in my Angular project. Its gives error While registering <code>ServiceWorkerModule</code> in <code>app.module.ts</code></p>
  
  <p><strong>app.module.ts</strong></p>
  
  <pre><code>@NgModule({
   imports: [
   ...
   ServiceWorkerModule.register('/ngsw-worker.js', { enabled: environment.production })
   ]
  })
  </code></pre>
  
  <p>When I run <code>ng build --prod</code> is giving me this error</p>
  
  <blockquote>
    <p>ERROR in ./src/main.ts
    Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/app/webel/src/main/webapp/webel/src'
    ERROR in Error: Metadata version mismatch for module /app/webel/src/main/webapp/webel/node_modules/@angular/service-worker/service-worker.d.ts, found version 4, expected 3
    at StaticSymbolResolver.getModuleMetadata (/app/webel/src/main/webapp/webel/node_modules/@angular/compiler/bundles/compiler.umd.js:25616:34)
        at StaticSymbolResolver._createSymbolsOf (/app/webel/src/main/webapp/webel/node_modules/@angular/compiler/bundles/compiler.umd.js:25404:46)
        at StaticSymbolResolver.getSymbolsOf (/app/webel/src/main/webapp/webel/node_modules/@angular/compiler/bundles/compiler.umd.js:25385:14)
        at /app/webel/src/main/webapp/webel/node_modules/@angular/compiler/bundles/compiler.umd.js:24241:30
        at Array.forEach ()
        at extractProgramSymbols (/app/webel/src/main/webapp/webel/node_modules/@angular/compiler/bundles/compiler.umd.js:24240:79)
        at AotCompiler.analyzeModulesAsync (/app/webel/src/main/webapp/webel/node_modules/@angular/compiler/bundles/compiler.umd.js:23796:47)
        at CodeGenerator.codegen (/app/webel/src/main/webapp/webel/node_modules/@angular/compiler-cli/src/codegen.js:32:14)
        at Function.NgTools_InternalApi_NG_2.codeGen (/app/webel/src/main/webapp/webel/node_modules/@angular/compiler-cli/src/ngtools_api.js:73:30)
        at _donePromise.Promise.resolve.then (/app/webel/src/main/webapp/webel/node_modules/@ngtools/webpack/src/plugin.js:428:58)
        at 
        at process._tickCallback (internal/process/next_tick.js:160:7)</p>
  </blockquote>
  
  <p>I am using versions as below,</p>
  
  <pre><code>"@angular/cli": "^1.7.3"
  "ng-pwa-tools": "0.0.15"
  "@angular/service-worker": "^6.0.1"
  "@angular/compiler": "^4.4.4"
  </code></pre>
  
  <p>Any help would be appreciated.</p>