首页 > 解决方案 > 当 ng build 运行良好时,为什么 ng build -c dev 会显示错误?

问题描述

在我的本地 PC 上运行 Angular 并运行一个基本的 ng build 命令。

当我运行 ng build 时,一切都按预期工作。

当我尝试通过运行 ng build -c dev 使用我的 environment.dev.ts 文件运行时,我得到了无数错误。这些是真正的错误吗?如果是这样,为什么它们只在这种情况下显示?

其中一些错误的示例:

ERROR in src\app\main\header-dialog\header-dialog.component.html(66,21): : Property 'primary' does not exist on type 'HeaderDialogComponent'.
src\app\main\header-dialog\header-dialog.component.html(67,21): : Property 'determinate' does not exist on type 'HeaderDialogComponent'.
src\app\main\header-dialog\header-dialog.component.html(168,19): : Property 'primary' does not exist on type 'HeaderDialogComponent'.
src\app\main\header-dialog\header-dialog.component.html(169,19): : Property 'determinate' does not exist on type 'HeaderDialogComponent'.
src\app\main\header-dialog\header-dialog.component.html(246,19): : Property 'primary' does not exist on type 'HeaderDialogComponent'.
src\app\main\header-dialog\header-dialog.component.html(247,19): : Property 'determinate' does not exist on type 'HeaderDialogComponent'.
node_modules\@ng-bootstrap\ng-bootstrap\datepicker\datepicker-navigation.d.ts.NgbDatepickerNavigation.html(3,67): : An expression of type 'void' cannot be tested for truthiness
node_modules\@ng-bootstrap\ng-bootstrap\datepicker\datepicker-navigation.d.ts.NgbDatepickerNavigation.html(25,67): : An expression of type 'void' cannot be tested for truthiness

标签: angular-cling-build

解决方案


推荐阅读