简体   繁体   中英

“ng build --prod --base-href=/App_name/ --env=prod” throwing Error

I want to publish my angular app in local iis but When i run below command it will throw error

ng build --prod --base-href=/App_name/ --env=prod

ERROR in Error: Template parse errors: 'app-header' is not a known element: 1. If 'app-header' is an Angular component, then verify that it is part of this module.

FYO : 1) normal "ng build" and "ng serve" is running fine. 2) AppHeaderCompo is also declared inside app.module

These are the 5 steps I perform when I got such an error.

  1. Are you sure the name is correct? (also check the selector defined in the component)
  2. Declare the component in a module?
  3. If it is in another module, export the component?
  4. If it is in another module, import that module?
  5. Restart the cli?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM