首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >角度示意图例外:“不支持:关键字”" ID“,使用"$id”表示模式ID

问角度示意图例外:“不支持:关键字”" ID“,使用"$id”表示模式ID
EN

Stack Overflow用户
提问于 2022-02-15 16:28:22
回答 2查看 3.4K关注 0票数 1

我有一个不适用于新项目的自定义原理图.我也看了this question,但我不能让它工作.

我的主工作区使用以下配置运行:

代码语言:javascript
复制
Angular CLI: 13.2.3
Node: 16.13.0
Package Manager: npm 7.24.2
OS: win32 x64

Angular: 13.2.2
... core

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1302.3 (cli-only)
@angular-devkit/core         11.2.18
@angular-devkit/schematics   11.2.18
@schematics/angular          13.2.3 (cli-only)
@schematics/update           0.1102.18

我的项目是这样的:

代码语言:javascript
复制
Angular CLI: 13.2.3
Node: 16.13.0
Package Manager: npm 7.24.2
OS: win32 x64

Angular: 13.2.2
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router     

Package                         Version
---------------------------------------------------------  
@angular-devkit/architect       0.1302.3
@angular-devkit/build-angular   13.2.3
@angular-devkit/core            13.2.3
@angular-devkit/schematics      13.2.3
@angular/cli                    13.2.3
@schematics/angular             13.2.3
rxjs                            7.5.4
typescript                      4.5.5

在我的工作区中,我可以在没有问题的情况下创建一个新项目;然后我在其中移动,当我运行命令ng g project-template-13:project-template-13 (我的自定义原理图)时,会抛出以下异常:

代码语言:javascript
复制
[error] Error: Collection "project-template-13" cannot be resolved.
at SchematicEngineHost.resolve (C:\Users\user\workspace\my-project\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:75:19)
at SchematicEngineHost._resolveCollectionPath (C:\Users\user\workspace\my-project\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:80:37)
at SchematicEngineHost.createCollectionDescription (C:\Users\user\workspace\my-project\node_modules\@angular-devkit\schematics\tools\file-system-engine-host-base.js:118:27)
at SchematicEngine._createCollectionDescription (C:\Users\user\workspace\my-project\node_modules\@angular-devkit\schematics\src\engine\engine.js:162:40)
at SchematicEngine.createCollection (C:\Users\user\workspace\my-project\node_modules\@angular-devkit\schematics\src\engine\engine.js:155:43)
at GenerateCommand.getCollection (C:\Users\user\workspace\my-project\node_modules\@angular\cli\models\schematic-command.js:143:35)
at GenerateCommand.initialize (C:\Users\user\workspace\my-project\node_modules\@angular\cli\models\schematic-command.js:62:37)
at async GenerateCommand.initialize (C:\Users\user\workspace\my-project\node_modules\@angular\cli\commands\generate-impl.js:20:9)
at async GenerateCommand.validateAndRun (C:\Users\user\workspace\my-project\node_modules\@angular\cli\models\command.js:121:22)
at async runCommand (C:\Users\user\workspace\my-project\node_modules\@angular\cli\models\command-runner.js:224:24)

正如上面提到的问题中所说的,我尝试过将降到12角,但它似乎不起作用。有人能帮我吗?

P.s. --如果需要,我会提供更多信息

EN

回答 2

Stack Overflow用户

发布于 2022-02-15 16:47:32

尝试在主工作区上执行ng更新,因为该问题可能是由于版本不匹配引起的。这些套餐:

代码语言:javascript
复制
@angular-devkit/core         11.2.18
@angular-devkit/schematics   11.2.18

应该是十三岁了。

票数 0
EN

Stack Overflow用户

发布于 2022-05-03 20:23:27

如果这有助于其他人在使用nx时,我必须手动更新使用ng-packagr构建的现有库的angular.json,从“@angular/ build packagr”到“@nrwl/angular:ng-packagr”。然后从我的项目中删除依赖关系@angular/build packagr。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71129995

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档