16

我正在转换一个库(ng-app-state)以使用 angular cli,现在v6 支持库(耶!)。

当尝试运行某些 CLI 命令时,它会失败并出现如下错误:

$ ng test --source-map ng-app-state
Architect commands with multiple targets cannot specify overrides.'test' would be run on the following projects: ng-app-state-monorepo,ng-app-state
Error: Architect commands with multiple targets cannot specify overrides.'test' would be run on the following projects: ng-app-state-monorepo,ng-app-state
    at TestCommand.validate (S:\Programming\git repositories\ng-app-state-monorepo\node_modules\@angular\cli\models\architect-command.js:91:23)
4

2 回答 2

26

您需要先输入库名称,然后再输入选项。例如

# do this
$ ng test ng-app-state --watch=true --source-map

# don't do this
$ ng test --watch=true --source-map ng-app-state
于 2018-05-05T13:23:29.887 回答
0

如果您有多个应用程序,则可以在下面的命令中提及其名称。

yarn test web --code-coverage

这里 web 是 Angular 项目中的应用程序。

于 2019-03-05T06:35:48.390 回答