我已经检查了Collection “@schematics/angular” 无法解析 并且它不是重复的。
我已经创建了自己的原理图,当我尝试使用它时,ng add @candiman/website@0.0.5-beta.3
我遇到了以下错误。
我认为问题是collection.json
没有打包发货到npm package
asng-packgr
不包含JSON
文件
因此,npm 包文件夹中不存在物理collection.json
,并且当原理图搜索collection.json
文件时失败。
Collection "@candiman/website" cannot be resolved.
Error: Collection "@candiman/website" cannot be resolved.
at NodeModulesEngineHost._resolveCollectionPath (/Users/aniruddh/aniruddh/develop/experiment/schematics-exp/sche-ex1/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:91:15)
at NodeModulesEngineHost.createCollectionDescription (/Users/aniruddh/aniruddh/develop/experiment/schematics-exp/sche-ex1/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:111:27)
at SchematicEngine._createCollectionDescription (/Users/aniruddh/aniruddh/develop/experiment/schematics-exp/sche-ex1/node_modules/@angular-devkit/schematics/src/engine/engine.js:147:40)
at SchematicEngine.createCollection (/Users/aniruddh/aniruddh/develop/experiment/schematics-exp/sche-ex1/node_modules/@angular-devkit/schematics/src/engine/engine.js:140:43)
at AddCommand.getCollection (/Users/aniruddh/aniruddh/develop/experiment/schematics-exp/sche-ex1/node_modules/@angular/cli/models/schematic-command.js:123:35)
at AddCommand.runSchematic (/Users/aniruddh/aniruddh/develop/experiment/schematics-exp/sche-ex1/node_modules/@angular/cli/models/schematic-command.js:262:50)
at AddCommand.executeSchematic (/Users/aniruddh/aniruddh/develop/experiment/schematics-exp/sche-ex1/node_modules/@angular/cli/commands/add-impl.js:134:31)
at AddCommand.run (/Users/aniruddh/aniruddh/develop/experiment/schematics-exp/sche-ex1/node_modules/@angular/cli/commands/add-impl.js:105:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
@candiman/website@0.0.5-beta.3
现在可以使用原理图npm
了,如果有人想尝试一下。
Angular 库的源代码可以在发布带有原理图的 npm 包的项目源中找到