为什么用于生成解析器的 cli 命令会抛出异常?

Why does the cli command for generating a resolver throw exception?

如您在cli documentation中所见,有一个生成解析器的命令。但是,当我尝试从 VS Code 终端使用它时,它会抛出异常 -

An unhandled exception occurred: Schematic "resolver" not found in collection "@schematics/angular".

我是不是做错了什么?有人用过吗?

我假设您使用的不是最新版本的 angular cli。 resolver原理图是最近才加的(今年10月份),看这个commit.

当前版本 11.0.1 应该可以正常工作。 您可以在 运行 ng generate --help.

时验证可用的原理图命令