Angular 8 - TypeError: Class constructor EventEmitter cannot be invoked without 'new'

Angular 8 - TypeError: Class constructor EventEmitter cannot be invoked without 'new'

我刚刚将我的 Ionic 4 应用程序从 Angular 7 更新到 Angular 8。但是,当我 运行 ng serve 时,它打开空白,我得到了这个我的浏览器控制台出错...

AppComponent_Host.ngfactory.js? [sm]:1 ERROR TypeError: Class constructor EventEmitter cannot be invoked without 'new'
    at new BackButtonEmitter (platform.js:29)
    at new Platform (platform.js:44)
    at _createClass (core.js:23184)
    at _createProviderInstance (core.js:23151)
    at resolveNgModuleDep (core.js:23098)
    at NgModuleRef_.get (core.js:24206)
    at resolveDep (core.js:24736)
    at createClass (core.js:24589)
    at createDirectiveInstance (core.js:24400)
    at createViewNodes (core.js:35006)

知道这是关于什么的吗?

您必须输入代码,以便用户知道您在做什么,

我回答你问的问题,同样的错误告诉你,你必须这样做你必须用New初始化EventEmitter类型的变量,这样

   @Output() variableEmit: EventEmitter<any> = new EventEmitter();

希望您能帮忙标记为对其他用户有用的答案

我通过更新整个 package.json 列表来修复它... https://flaviocopes.com/update-npm-dependencies/