1Specify the module using the --module parameter.
2For example, if the main module is app.module.ts, run this:
3
4ng g c new-component --module app
5Or if you are in an other directory then
6
7ng g c component-name --module ../
1ng g c new-component --module app
2//Or if you are in an other directory then
3ng g c component-name --module ../