有角的ng build --prod问题 [英] Angular `ng build --prod` issue

查看:104
本文介绍了有角的ng build --prod问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我这样做的时候 ->'ng build --prod' 我收到此错误

when i did --> 'ng build --prod' i got this error

ERROR in:无法确定以下类中AppComponent类的模块 E:/GitNew/Terminal2/Terminal2/terminal2/src/app/app.component.ts!添加 将AppComponent绑定到NgModule进行修复.
无法确定类OfferCreationFinalForwarderComponent的模块 在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/offer-creation-final- forwarder/offer-creation-final-forwarder.component.ts!添加 OfferCreationFinalForwarderComponent可以修复到NgModule.无法确定E:/GitNew/Terminal2/Terminal2/terminal2/src/app/offer-common-top/offer-common-top.component.ts中的OfferCommonTopComponent类的模块!将OfferCommonTopComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/offer-common-right/offer-common-right.component.ts中确定OfferCommonRightComponent类的模块!将OfferCommonRightComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/top-menu/top-menu.component.ts中确定类TopMenuComponent的模块!将TopMenuComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/booking-creation/booking-creation.component.ts中确定用于BookingCreationComponent类的模块!将BookingCreationComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/ship/comper-right-menu/shipper-common-right-menu.component.ts中确定ShipperCommonRightMenuComponent类的模块!将ShipperCommonRightMenuComponent添加到NgModule进行修复.无法确定E:/GitNew/Terminal2/Terminal2/terminal2/src/app/booking-shipper-common-top/booking-shipper-common-top.component.ts中的BookingShipperCommonTopComponent类的模块!将BookingShipperCommonTopComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/jobboard/jobboard.component.ts中确定JobboardComponent类的模块!将JobboardComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/log-in/log-in.component.ts中确定类LogInComponent的模块!将LogInComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/registration/registration.component.ts中确定类RegistrationComponent的模块!将RegistrationComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/top-menu-registration/top-menu-registration.component.ts中确定类TopMenuRegistrationComponent的模块!将TopMenuRegistrationComponent添加到NgModule中以对其进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/home/home.component.ts中确定类HomeComponent的模块!将HomeComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/documents/documents.component.ts中确定DocumentsComponent类的模块!将DocumentsComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/market-place/market-place.component.ts中确定MarketPlaceComponent类的模块!将MarketPlaceComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/shipper-letter-instruction/shipper-letter-instruction.component.ts中确定ShipperLetterInstructionComponent类的模块!将ShipperLetterInstructionComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/acceptance/acceptance.component.ts中确定类AcceptanceComponent的模块!将AcceptanceComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/final-charges/final-charges.component.ts中确定FinalChargesComponent类的模块!将FinalChargesComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/bookings-forwarder/bookings-forwarder.component.ts中确定BookingsForwarderComponent类的模块!将BookingsForwarderComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/iwdatables/iwdatables.component.ts中确定IwdatablesComponent类的模块!将IwdatablesComponent添加到NgModule中以对其进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/check-out/check-out.component.ts中为CheckOutComponent类确定模块!将CheckOutComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/shipper-consignee/shipper-consignee.component.ts中确定ShipperConsigneeComponent类的模块!将ShipperConsigneeComponent添加到NgModule中进行修复.无法确定E:/GitNew/Terminal2/Terminal2/terminal2/src/app/booking-documents/booking-documents.component.ts中的BookingDocumentsComponent类的模块!将BookingDocumentsComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/my-bookings/my-bookings.component.ts中确定MyBookingsComponent类的模块!将MyBookingsComponent添加到NgModule中以对其进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/local-charges-tables/local-charges-tables.component.ts中确定LocalChargesTablesComponent类的模块!将LocalChargesTablesComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/directives/blockcopypaste.directive.ts中确定类BlockCopyPasteComponent的模块!将BlockCopyPasteComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/directives/clickOutside.directive.ts中确定类ClickOutsideDirective的模块!将ClickOutsideDirective添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/directives/decimal.directive.ts中确定类OnlyNumber的模块!将OnlyNumber添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/documentsupload/documentsupload.component.ts中确定DocumentsuploadComponent类的模块!将DocumentsuploadComponent添加到NgModule中进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/terminal2/src/app/alloffers/alloffers.component.ts中确定AlloffersComponent类的模块!将AlloffersComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/jobboard/searchfilter.pipe.ts中确定类SearchFilterPipe的模块!将SearchFilterPipe添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/src/app/myoffers/myoffers.component.ts中确定MyoffersComponent类的模块!将MyoffersComponent添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/allbookings/allbookings.component.ts中确定AllbookingsComponent类的模块!将AllbookingsComponent添加到NgModule中以对其进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/allpayments/allpayments.component.ts中确定类AllpaymentsComponent的模块!将AllpaymentsComponent添加到NgModule中进行修复.无法在E:/GitNew/Terminal2/Terminal2/Terminal2/terminal2/src/app/directives/block-copy-paste.directive.ts中确定类BlockCopyPasteDirective的模块!将BlockCopyPasteDirective添加到NgModule进行修复.无法在E:/GitNew/Terminal2/Terminal2/terminal2/terminal2/src/app/app.module.ts中确定类AppModule的模块!将AppModule添加到NgModule进行修复.

ERROR in : Cannot determine the module for class AppComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/app.component.ts! Add AppComponent to the NgModule to fix it.
Cannot determine the module for class OfferCreationFinalForwarderComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/offer-creation-final- forwarder/offer-creation-final-forwarder.component.ts! Add OfferCreationFinalForwarderComponent to the NgModule to fix it. Cannot determine the module for class OfferCommonTopComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/offer-common-top/offer-common-top.component.ts! Add OfferCommonTopComponent to the NgModule to fix it. Cannot determine the module for class OfferCommonRightComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/offer-common-right/offer-common-right.component.ts! Add OfferCommonRightComponent to the NgModule to fix it. Cannot determine the module for class TopMenuComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/top-menu/top-menu.component.ts! Add TopMenuComponent to the NgModule to fix it. Cannot determine the module for class BookingCreationComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/booking-creation/booking-creation.component.ts! Add BookingCreationComponent to the NgModule to fix it. Cannot determine the module for class ShipperCommonRightMenuComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/shipper-common-right-menu/shipper-common-right-menu.component.ts! Add ShipperCommonRightMenuComponent to the NgModule to fix it. Cannot determine the module for class BookingShipperCommonTopComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/booking-shipper-common-top/booking-shipper-common-top.component.ts! Add BookingShipperCommonTopComponent to the NgModule to fix it. Cannot determine the module for class JobboardComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/jobboard/jobboard.component.ts! Add JobboardComponent to the NgModule to fix it. Cannot determine the module for class LogInComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/log-in/log-in.component.ts! Add LogInComponent to the NgModule to fix it. Cannot determine the module for class RegistrationComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/registration/registration.component.ts! Add RegistrationComponent to the NgModule to fix it. Cannot determine the module for class TopMenuRegistrationComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/top-menu-registration/top-menu-registration.component.ts! Add TopMenuRegistrationComponent to the NgModule to fix it. Cannot determine the module for class HomeComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/home/home.component.ts! Add HomeComponent to the NgModule to fix it. Cannot determine the module for class DocumentsComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/documents/documents.component.ts! Add DocumentsComponent to the NgModule to fix it. Cannot determine the module for class MarketPlaceComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/market-place/market-place.component.ts! Add MarketPlaceComponent to the NgModule to fix it. Cannot determine the module for class ShipperLetterInstructionComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/shipper-letter-instruction/shipper-letter-instruction.component.ts! Add ShipperLetterInstructionComponent to the NgModule to fix it. Cannot determine the module for class AcceptanceComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/acceptance/acceptance.component.ts! Add AcceptanceComponent to the NgModule to fix it. Cannot determine the module for class FinalChargesComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/final-charges/final-charges.component.ts! Add FinalChargesComponent to the NgModule to fix it. Cannot determine the module for class BookingsForwarderComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/bookings-forwarder/bookings-forwarder.component.ts! Add BookingsForwarderComponent to the NgModule to fix it. Cannot determine the module for class IwdatablesComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/iwdatables/iwdatables.component.ts! Add IwdatablesComponent to the NgModule to fix it. Cannot determine the module for class CheckOutComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/check-out/check-out.component.ts! Add CheckOutComponent to the NgModule to fix it. Cannot determine the module for class ShipperConsigneeComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/shipper-consignee/shipper-consignee.component.ts! Add ShipperConsigneeComponent to the NgModule to fix it. Cannot determine the module for class BookingDocumentsComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/booking-documents/booking-documents.component.ts! Add BookingDocumentsComponent to the NgModule to fix it. Cannot determine the module for class MyBookingsComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/my-bookings/my-bookings.component.ts! Add MyBookingsComponent to the NgModule to fix it. Cannot determine the module for class LocalChargesTablesComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/local-charges-tables/local-charges-tables.component.ts! Add LocalChargesTablesComponent to the NgModule to fix it. Cannot determine the module for class BlockCopyPasteComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/directives/blockcopypaste.directive.ts! Add BlockCopyPasteComponent to the NgModule to fix it. Cannot determine the module for class ClickOutsideDirective in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/directives/clickOutside.directive.ts! Add ClickOutsideDirective to the NgModule to fix it. Cannot determine the module for class OnlyNumber in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/directives/decimal.directive.ts! Add OnlyNumber to the NgModule to fix it. Cannot determine the module for class DocumentsuploadComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/documentsupload/documentsupload.component.ts! Add DocumentsuploadComponent to the NgModule to fix it. Cannot determine the module for class AlloffersComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/alloffers/alloffers.component.ts! Add AlloffersComponent to the NgModule to fix it. Cannot determine the module for class SearchFilterPipe in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/jobboard/searchfilter.pipe.ts! Add SearchFilterPipe to the NgModule to fix it. Cannot determine the module for class MyoffersComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/myoffers/myoffers.component.ts! Add MyoffersComponent to the NgModule to fix it. Cannot determine the module for class AllbookingsComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/allbookings/allbookings.component.ts! Add AllbookingsComponent to the NgModule to fix it. Cannot determine the module for class AllpaymentsComponent in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/allpayments/allpayments.component.ts! Add AllpaymentsComponent to the NgModule to fix it. Cannot determine the module for class BlockCopyPasteDirective in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/directives/block-copy-paste.directive.ts! Add BlockCopyPasteDirective to the NgModule to fix it. Cannot determine the module for class AppModule in E:/GitNew/Terminal2/Terminal2/terminal2/src/app/app.module.ts! Add AppModule to the NgModule to fix it.

我已经删除了node_modules并再次重新安装仍然是同样的问题.

I have removed node_modules and reinstalled again still same issue..

app.module.ts

 @NgModule({
   declarations: [
   AppComponent,
   OfferCreationFinalForwarderComponent,
   OfferCommonTopComponent,
   OfferCommonRightComponent,
   TopMenuComponent,
   ...........

参考链接选中此

推荐答案

如果ng build正常,则应考虑以下几点

If ng build works fine, here are my points you should consider

1)''{Base:类型上不存在'apiBaseUrl' }'-检查您的environment.prod.ts文件.它具有apiBaseUrl吗?

1) 'apiBaseUrl' does not exist on type '{ production: boolean; }' - check your environment.prod.ts file. Is it having the apiBaseUrl?

2)在cli上运行prod构建时,您的组件可能会出错,并且Angular并未特别指定它.

2) While running the prod build on the cli, you may have errors with your components and Angular does not specify that it in particular.

希望这会有所帮助

这篇关于有角的ng build --prod问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆