升级到angular9问题:找不到节点的导出名称

升级到angular9问题:找不到节点的导出名称,angular,npm,angular9,angular-upgrade,Angular,Npm,Angular9,Angular Upgrade,升级到Angular 9并尝试运行我的项目后,我出现以下错误: Compiling @angular/common/http : module as esm5 Compiling angular-font-awesome : module as esm5 Compiling angular-font-awesome : module as esm5 Error: Error on worker #5: Error: Failed to find exported name of node (Co

升级到Angular 9并尝试运行我的项目后,我出现以下错误:

Compiling @angular/common/http : module as esm5
Compiling angular-font-awesome : module as esm5
Compiling angular-font-awesome : module as esm5
Error: Error on worker #5: Error: Failed to find exported name of node (CommonModule = (function () {
    function CommonModule() {
    }
    return CommonModule;
}())) in 'C:/Users/.../node_modules/angular-font-awesome/dist/angular-font-awesome.es5.js'.
    at Object.findExportedNameOfNode (C:\Users\...\node_modules\@angular\compiler-cli\src\ngtsc\imports\src\find_export.js:35:19)
    at LogicalProjectStrategy.emit (C:\Users\Ghaida\...\node_modules\@angular\compiler-cli\src\ngtsc\imports\src\emitter.js:228:38)
    at ReferenceEmitter.emit (C:\Users\...\node_modules\@angular\compiler-cli\src\ngtsc\imports\src\emitter.js:71:44)
    at Object.toR3Reference (C:\Users\...\node_modules\@angular\compiler-cli\src\ngtsc\annotations\src\util.js:173:31)
    at NgModuleDecoratorHandler._toR3Reference (C:\Users\...\node_modules\@angular\compiler-cli\src\ngtsc\annotations\src\ng_module.js:415:31)
    at C:\Users\...\node_modules\@angular\compiler-cli\src\ngtsc\annotations\src\ng_module.js:196:72
    at Array.map (<anonymous>)
    at NgModuleDecoratorHandler.analyze (C:\Users\...\node_modules\@angular\compiler-cli\src\ngtsc\annotations\src\ng_module.js:196:38)


PS:我运行了“ng更新”,得到了“我们分析了你的package.json,一切似乎都正常。”

移除后问题已解决

  • mypackage.json中的角度字体
  • 来自app.module.ts的AngularFontawesome模块

  • 在编译font awesome软件包时,错误地运行npm安装。当我展示我从ngModule中删除了这个包,它就可以工作了。

    这个库angular font Asome是用angular v4构建的!!在v9中不可能支持它。应将其从package.json中删除。下面是一个

    并没有真正回答这个问题,但看起来这个库-存储库的作者已经存档了。考虑切换到FA 5。这个解决方案是如何解决的?嗯,根据上面所示的错误,有一些事情与AngularFontAwesomeModule无关。因此,建议的解决方案解决了我的问题,错误消失了,这对我很有效,谢谢!我渴望有一天,Angular会向我们提供有意义的错误信息,并提示原因,而不是我们必须跑到StackOverflow去破译错误信息!!!那么对于is angular版本,我不能使用angular font awesome npm吗?您在html文件中使用的font awesome类呢?这是否仍然有效,或者您也必须删除这些类?
    Angular CLI: 9.1.0
    Node: 10.15.0
    OS: win32 x64
    
    Angular: 9.1.0
    ... animations, cli, common, compiler, compiler-cli, core, forms
    ... language-service, platform-browser, platform-browser-dynamic
    ... platform-server, router
    Ivy Workspace: Yes
    
    Package                           Version
    -----------------------------------------------------------
    @angular-devkit/architect         0.901.0
    @angular-devkit/build-angular     0.901.0
    @angular-devkit/build-optimizer   0.901.0
    @angular-devkit/build-webpack     0.901.0
    @angular-devkit/core              9.1.0
    @angular-devkit/schematics        9.1.0
    @angular/http                     7.2.16
    @ngtools/webpack                  9.1.0
    @schematics/angular               9.1.0
    @schematics/update                0.901.0
    rxjs                              6.5.4
    typescript                        3.8.3
    webpack                           4.42.0