ng g c c-name => 指定模块不存在

ng g c c-name => Specified module does not exist

我现在的目录

/src/app

app.module.ts 目录

/src/app/app.module.ts

我需要这个目录中的新组件

catalog/single/configurator/[new component here]

正在尝试添加组件 #1

ng g c catalog/single/configurator/details-popout --module AppModule

Specified module does not exist

正在尝试添加组件 #2

ng g c catalog/single/configurator/details-popout --module /app.module

Invalid rule result: Function().

正在尝试添加组件 #3

ng g c catalog/single/configurator/details-popout --module app

Invalid rule result: Function().


问题

如何使用 Angular CLI 添加组件 details-popout

环境

Angular CLI: 6.0.8
Node: 9.2.0
OS: darwin x64
Angular: 6.1.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.8
@angular-devkit/build-angular     0.6.8
@angular-devkit/build-optimizer   0.6.8
@angular-devkit/core              0.6.8
@angular-devkit/schematics        0.7.5
@angular/cli                      6.0.8
@angular/fire                     5.0.0
@angular/pwa                      0.6.8
@ngtools/webpack                  6.0.8
@schematics/angular               0.7.5
@schematics/update                0.6.8
rxjs                              6.3.2
typescript                        2.7.2
webpack                           4.8.3

ng g c catalog/single/configurator/details-popout --module app.module.ts

Allows specification of the declaring module's file name (e.g app.module.ts).

Doc is here

真正的问题是:

确保您的 @angular/cli 软件包已更新到最新版本 运行:

npm install -g @angular/cli