title: Ng serve throwing @angular/core/core has no exported member 'ɵɵFactoryDeclaration'
body: <p>I'm getting errors stating that <em><strong>angular/core/core has no exported member 'ɵɵFactoryDeclaration'</strong></em> while I ran <code>ng serve</code> on angular9 project. The error I am getting is</p>
  <pre><code>ERROR in node_modules/angular-google-tag-manager/lib/angular-google-tag-manager.service.d.ts:18:21 - error TS2694: Namespace '&quot;/mnt/db39af7f-bc9a-47a8-9fc8-d11b12e7dff2/Digicorp/Jewelegance/application/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵFactoryDeclaration'.
  
  18     static ɵfac: i0.ɵɵFactoryDeclaration&lt;GoogleTagManagerService, [{ optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]&gt;;
                         ~~~~~~~~~~~~~~~~~~~~
  node_modules/angular-google-tag-manager/lib/angular-google-tag-manager.service.d.ts:19:22 - error TS2694: Namespace '&quot;/mnt/db39af7f-bc9a-47a8-9fc8-d11b12e7dff2/Digicorp/Jewelegance/application/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵInjectableDeclaration'.
  
  19     static ɵprov: i0.ɵɵInjectableDeclaration&lt;GoogleTagManagerService&gt;;
                          ~~~~~~~~~~~~~~~~~~~~~~~
  node_modules/angular-google-tag-manager/lib/angular-google-tag-manager.module.d.ts:6:21 - error TS2694: Namespace '&quot;/mnt/db39af7f-bc9a-47a8-9fc8-d11b12e7dff2/Digicorp/Jewelegance/application/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵFactoryDeclaration'.
  
  6     static ɵfac: i0.ɵɵFactoryDeclaration&lt;GoogleTagManagerModule, never&gt;;
                        ~~~~~~~~~~~~~~~~~~~~
  node_modules/angular-google-tag-manager/lib/angular-google-tag-manager.module.d.ts:7:21 - error TS2694: Namespace '&quot;/mnt/db39af7f-bc9a-47a8-9fc8-d11b12e7dff2/Digicorp/Jewelegance/application/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵNgModuleDeclaration'.
  
  7     static ɵmod: i0.ɵɵNgModuleDeclaration&lt;GoogleTagManagerModule, never, never, never&gt;;
                        ~~~~~~~~~~~~~~~~~~~~~
  node_modules/angular-google-tag-manager/lib/angular-google-tag-manager.module.d.ts:8:21 - error TS2694: Namespace '&quot;/mnt/db39af7f-bc9a-47a8-9fc8-d11b12e7dff2/Digicorp/Jewelegance/application/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵInjectorDeclaration'.
  
  8     static ɵinj: i0.ɵɵInjectorDeclaration&lt;GoogleTagManagerModule&gt;;
                        ~~~~~~~~~~~~~~~~~~~~~
  
  ** Angular Live Development Server is listening on 0.0.0.0:4200, open your browser on http://localhost:4200/ **
  60% building 41/41 modules 0 active    
      ERROR in node_modules/angular-google-tag-manager/lib/angular-google-tag-manager.service.d.ts:18:21 - error TS2694: Namespace '&quot;/mnt/db39af7f-bc9a-47a8-9fc8-d11b12e7dff2/Digicorp/Jewelegance/application/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵFactoryDeclaration'.
      
      18     static ɵfac: i0.ɵɵFactoryDeclaration&lt;GoogleTagManagerService, [{ optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]&gt;;
                             ~~~~~~~~~~~~~~~~~~~~
      node_modules/angular-google-tag-manager/lib/angular-google-tag-manager.service.d.ts:19:22 - error TS2694: Namespace '&quot;/mnt/db39af7f-bc9a-47a8-9fc8-d11b12e7dff2/Digicorp/Jewelegance/application/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵInjectableDeclaration'.
      
      19     static ɵprov: i0.ɵɵInjectableDeclaration&lt;GoogleTagManagerService&gt;;
                              ~~~~~~~~~~~~~~~~~~~~~~~
      node_modules/angular-google-tag-manager/lib/angular-google-tag-manager.module.d.ts:6:21 - error TS2694: Namespace '&quot;/mnt/db39af7f-bc9a-47a8-9fc8-d11b12e7dff2/Digicorp/Jewelegance/application/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵFactoryDeclaration'.
      
      6     static ɵfac: i0.ɵɵFactoryDeclaration&lt;GoogleTagManagerModule, never&gt;;
                            ~~~~~~~~~~~~~~~~~~~~
      node_modules/angular-google-tag-manager/lib/angular-google-tag-manager.module.d.ts:7:21 - error TS2694: Namespace '&quot;/mnt/db39af7f-bc9a-47a8-9fc8-d11b12e7dff2/Digicorp/Jewelegance/application/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵNgModuleDeclaration'.
      
      7     static ɵmod: i0.ɵɵNgModuleDeclaration&lt;GoogleTagManagerModule, never, never, never&gt;;
                            ~~~~~~~~~~~~~~~~~~~~~
      node_modules/angular-google-tag-manager/lib/angular-google-tag-manager.module.d.ts:8:21 - error TS2694: Namespace '&quot;/mnt/db39af7f-bc9a-47a8-9fc8-d11b12e7dff2/Digicorp/Jewelegance/application/node_modules/@angular/core/core&quot;' has no exported member 'ɵɵInjectorDeclaration'.
      
      8     static ɵinj: i0.ɵɵInjectorDeclaration&lt;GoogleTagManagerModule&gt;;
                            ~~~~~~~~~~~~~~~~~~~~~
      
  
  Date: 2022-05-05T08:15:18.659Z - Hash: 3aa67f9dc972eec79277
  2 unchanged chunks
  chunk {main} main.js, main.js.map (main) 2.41 MB [initial] [rendered]
  chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 141 kB [initial] [rendered]
  chunk {styles} styles.js, styles.js.map (styles) 2.28 MB [initial] [rendered]
  chunk {vendor} vendor.js, vendor.js.map (vendor) 7.97 MB [initial] [rendered]
  Time: 42770ms
  
  WARNING in ./src/assets/css/main.min.css (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./src/assets/css/main.min.css)
  Module Warning (from ./node_modules/postcss-loader/src/index.js):
  Warning
  
  (160:28143) start value has mixed support, consider using flex-start instead
  
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 100:30-36
  Can't import the named export 'Inject' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 105:30-36
  Can't import the named export 'Inject' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 110:30-36
  Can't import the named export 'Inject' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 115:30-36
  Can't import the named export 'Inject' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 120:30-36
  Can't import the named export 'Inject' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 125:30-36
  Can't import the named export 'Inject' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 92:18-28
  Can't import the named export 'Injectable' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/ngx-window-token/fesm2015/ngx-window-token.mjs 3:19-33
  Can't import the named export 'InjectionToken' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 142:18-26
  Can't import the named export 'NgModule' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 98:30-38
  Can't import the named export 'Optional' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 103:30-38
  Can't import the named export 'Optional' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 108:30-38
  Can't import the named export 'Optional' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 113:30-38
  Can't import the named export 'Optional' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 118:30-38
  Can't import the named export 'Optional' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 123:30-38
  Can't import the named export 'Optional' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 89:478-496
  Can't import the named export 'ɵɵFactoryTarget' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 138:157-175
  Can't import the named export 'ɵɵFactoryTarget' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 91:0-27
  Can't import the named export 'ɵɵngDeclareClassMetadata' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 141:0-27
  Can't import the named export 'ɵɵngDeclareClassMetadata' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 89:31-52
  Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 138:30-51
  Can't import the named export 'ɵɵngDeclareFactory' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 90:32-56
  Can't import the named export 'ɵɵngDeclareInjectable' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 140:30-52
  Can't import the named export 'ɵɵngDeclareInjector' from non EcmaScript module (only default export is available)
  ERROR in ./node_modules/angular-google-tag-manager/fesm2015/angular-google-tag-manager.mjs 139:30-52
  Can't import the named export 'ɵɵngDeclareNgModule' from non EcmaScript module (only default export is available)
  </code></pre>
  <p>Here are my depencencies:</p>
  <pre><code>&quot;@angular/animations&quot;: &quot;^9.0.6&quot;,
  &quot;@angular/cdk&quot;: &quot;^9.1.2&quot;,
  &quot;@angular/common&quot;: &quot;~9.0.5&quot;,
  &quot;@angular/compiler&quot;: &quot;~9.0.5&quot;,
  &quot;@angular/core&quot;: &quot;~9.0.5&quot;,
  &quot;@angular/forms&quot;: &quot;~9.0.5&quot;,
  &quot;@angular/platform-browser&quot;: &quot;~9.0.5&quot;,
  &quot;@angular/platform-browser-dynamic&quot;: &quot;~9.0.5&quot;,
  &quot;@angular/platform-server&quot;: &quot;~9.0.5&quot;,
  &quot;@angular/router&quot;: &quot;~9.0.5&quot;,
  &quot;@fortawesome/angular-fontawesome&quot;: &quot;^0.6.0&quot;,
  &quot;@fortawesome/fontawesome-common-types&quot;: &quot;^0.2.27&quot;,
  &quot;@fortawesome/fontawesome-svg-core&quot;: &quot;^1.2.27&quot;,
  &quot;@nguniversal/express-engine&quot;: &quot;^9.0.2&quot;,
  &quot;@ngx-share/button&quot;: &quot;^7.1.4&quot;,
  &quot;@ngx-share/buttons&quot;: &quot;^7.1.4&quot;,
  &quot;@ngx-share/core&quot;: &quot;^7.1.4&quot;,
  &quot;angular-google-tag-manager&quot;: &quot;^1.3.0&quot;,
  &quot;chalk&quot;: &quot;^3.0.0&quot;,
  &quot;crypto-js&quot;: &quot;^4.0.0&quot;,
  &quot;express&quot;: &quot;^4.15.2&quot;,
  &quot;font-awesome&quot;: &quot;^4.7.0&quot;,
  &quot;fs&quot;: &quot;0.0.1-security&quot;,
  &quot;jquery&quot;: &quot;^3.4.1&quot;,
  &quot;knex&quot;: &quot;^0.20.11&quot;,
  &quot;lodash&quot;: &quot;^4.17.15&quot;,
  &quot;mysql&quot;: &quot;^2.18.1&quot;,
  &quot;ng-lazyload-image&quot;: &quot;^7.1.0&quot;,
  &quot;ng2-nouislider&quot;: &quot;^1.8.2&quot;,
  &quot;ng5-slider&quot;: &quot;^1.2.4&quot;,
  &quot;ngx-captcha&quot;: &quot;^8.0.1&quot;,
  &quot;ngx-clipboard&quot;: &quot;^13.0.0&quot;,
  &quot;ngx-cookie-service&quot;: &quot;^3.0.2&quot;,
  &quot;ngx-infinite-scroll&quot;: &quot;^8.0.1&quot;,
  &quot;ngx-mask&quot;: &quot;^8.1.7&quot;,
  &quot;ngx-quicklink&quot;: &quot;^0.2.0&quot;,
  &quot;ngx-sharebuttons&quot;: &quot;^4.1.4&quot;,
  &quot;primeicons&quot;: &quot;^2.0.0&quot;,
  &quot;primeng&quot;: &quot;^9.0.5&quot;,
  &quot;request&quot;: &quot;^2.88.2&quot;,
  &quot;request-promise&quot;: &quot;^4.2.5&quot;,
  &quot;rxjs&quot;: &quot;~6.5.4&quot;,
  &quot;tslib&quot;: &quot;^1.10.0&quot;,
  &quot;underscore&quot;: &quot;^1.10.2&quot;,
  &quot;xmlbuilder&quot;: &quot;^15.0.0&quot;,
  &quot;zone.js&quot;: &quot;~0.10.2&quot;
  </code></pre>
  <p>And here are my dev dependencies:</p>
  <pre><code>&quot;@angular-devkit/build-angular&quot;: &quot;~0.900.5&quot;,
  &quot;@angular/cli&quot;: &quot;~9.0.5&quot;,
  &quot;@angular/compiler-cli&quot;: &quot;~9.0.5&quot;,
  &quot;@angular/language-service&quot;: &quot;~9.0.5&quot;,
  &quot;@nguniversal/builders&quot;: &quot;^9.0.2&quot;,
  &quot;@types/express&quot;: &quot;^4.17.0&quot;,
  &quot;@types/node&quot;: &quot;^12.11.1&quot;,
  &quot;@types/jasmine&quot;: &quot;~3.5.0&quot;,
  &quot;@types/jasminewd2&quot;: &quot;~2.0.3&quot;,
  &quot;codelyzer&quot;: &quot;^5.1.2&quot;,
  &quot;jasmine-core&quot;: &quot;~3.5.0&quot;,
  &quot;jasmine-spec-reporter&quot;: &quot;~4.2.1&quot;,
  &quot;karma&quot;: &quot;~4.3.0&quot;,
  &quot;karma-chrome-launcher&quot;: &quot;~3.1.0&quot;,
  &quot;karma-coverage-istanbul-reporter&quot;: &quot;~2.1.0&quot;,
  &quot;karma-jasmine&quot;: &quot;~2.0.1&quot;,
  &quot;karma-jasmine-html-reporter&quot;: &quot;^1.4.2&quot;,
  &quot;protractor&quot;: &quot;~5.4.3&quot;,
  &quot;ts-node&quot;: &quot;~8.3.0&quot;,
  &quot;tslint&quot;: &quot;~5.18.0&quot;,
  &quot;typescript&quot;: &quot;~3.7.5&quot;
  </code></pre>
  <p><strong>What different approaches I have tried is</strong></p>
  <ol>
  <li><p>removed node_modules and package-lock.json and reinstall the app using <code>npm i</code></p>
  </li>
  <li><p>executed <code>npm ci</code></p>
  </li>
  <li><p>added in <em>tsconfig.json</em></p>
  <pre><code>&quot;compilerOptions&quot;: {
   ...
   &quot;paths&quot;: {
     &quot;@angular/*&quot;: [&quot;../node_modules/@angular/*&quot;]
   }
  },
  </code></pre>
  </li>
  <li><p>removed <em>angular-google-tag-manager</em> and install it through <code>npm i angular-google-tag-manager</code></p>
  </li>
  <li><p><code>npm update</code></p>
  </li>
  </ol>
  <p><strong>Environment</strong></p>
  <pre><code>Angular CLI: 9.0.7
  Node: 12.22.12
  OS: linux x64
  npm 6.14.16
  tsc 3.8.3
  </code></pre>