【发布时间】:2021-09-02 13:50:53
【问题描述】:
当我尝试在项目中的任何位置创建新组件时出现此错误:
PS C:\Users\Name\Documents\Project\project-app\src\app\modals> ng g c especificacaoTecnicaModal
Schematic input does not validate against the Schema: {"path":"/src/app/modals","displayBlock":false,"inlineStyle":false,"inlineTemplate":false,"changeDetection":"Default","style":"css","type":"Component","skipTests":false,"flat":false,"skipImport":false,"skipSelector":false,"export":false}
Errors:
Data path "" should have required property 'name'.
这是我的ng --version
Angular CLI: 6.1.4
Node: 14.17.0
OS: win32 x64
Angular: 6.1.10
... common, compiler, compiler-cli, core, forms, http
... language-service, platform-browser, platform-browser-dynamic
... router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.7.5
@angular-devkit/build-angular 0.7.5
@angular-devkit/build-optimizer 0.7.5
@angular-devkit/build-webpack 0.7.5
@angular-devkit/core 0.7.5
@angular-devkit/schematics 12.0.4
@angular/animations 12.0.4
@angular/cdk 7.3.7
@angular/material 7.3.7
@ngtools/webpack 6.1.5
@schematics/angular 12.0.4
@schematics/update <error>
rxjs 6.0.0
typescript 2.7.2
webpack 4.9.2
它是从我安装 Angular 材料时开始的。如果我尝试运行 ng serve 或 ng build --prod --base-href ./ 它运行正常。如果您需要更多数据,请发表评论,我会回答。
【问题讨论】:
-
看起来版本与您的 cli 版本不匹配。 CLI版本说6,原理图、devkit原理图和动画都是v12。
标签: angular angular-cli angular-cli-v6