Ng serve throwing @angular/core/core has no exported member 'eeFactoryDef'

前端 未结 6 826
说谎
说谎 2021-01-03 18:05

Im getting like 50 errors that all say that angular/core/core has no exported member \'eeFactoryDef\'.

They come from different node_modules, for example angular/cdk

相关标签:
6条回答
  • 2021-01-03 18:42

    I ran into this after updating some packages (including Angular from 8 to 9), then downgrading again.

    The solution was to nuke the node_modules folder and then do a fresh npm install.

    0 讨论(0)
  • 2021-01-03 18:46

    I run ino the same issue when trying to upgrade to Angular 10 in another feature branch.

    it messed up 'node_modules' folder.

    Solution:

    run npm ci.

    0 讨论(0)
  • 2021-01-03 18:50

    Delete folder node_modules then run the npm i command

    0 讨论(0)
  • 2021-01-03 18:51

    I'm getting the same error. I'm using Angular 9.7.1, I first tried to delete the node_modules and npm install but it didn't work so I finally fixed it adding this to the tsconfig.json:

    "compilerOptions":{
     [...]
     "paths": {
          "@angular/*": ["./node_modules/@angular/*"]
        }
    }
    
    0 讨论(0)
  • 2021-01-03 18:58

    Main project had Angular 8 and I got this issue when some packages with Angular 9 were installed. Use this for upgrade steps: https://update.angular.io - specifically upgrade to latest version of 8 ng update @angular/core@8 @angular/cli@8 then to 9 ng update @angular/core@9 @angular/cli@9.

    0 讨论(0)
  • 2021-01-03 19:00

    I got the issue when switching between Angular 8 and 9 multiple times as mentioned by peregrination.

    Solution for me was not to delete "node_module" and run "npm install" again, but to remove and re-install npm packages to angular 8 compatible version which were mentioned in the error.

    ERROR in node_modules/ngx-infinite-scroll/src/modules/infinite-scroll.directive.d.ts:27:25 - error TS2694: Namespace '"/opt/atlassian/pipelines/agent/build/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDef'.
    27     static ɵfac: ɵngcc0.ɵɵFactoryDef<InfiniteScrollDirective, never>;
                               ~~~~~~~~~~~~
    node_modules/ng-click-outside/lib_commonjs/click-outside.directive.d.ts:34:25 - error TS2694: Namespace '"/opt/atlassian/pipelines/agent/build/node_modules/@angular/core/core"' has no exported member 'ɵɵFactoryDef'.
    34     static ɵfac: ɵngcc0.ɵɵFactoryDef<ClickOutsideDirective, never>;
    
    0 讨论(0)
提交回复
热议问题