You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Angular/Ionic生成组件遇Schema错误,求助解决方案

Ionic/Angular 组件生成报错求助

问题现象

  • 执行 ng generate component 生成组件时,报错:Schematic "appShell" not found in collection "@ionic/angular-toolkit"
  • 执行 ionic generate component 生成组件时,报错:An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID

错误栈信息

[error] Error: NOT SUPPORTED: keyword "id", use "$id" for schema ID
at Object.code (C:\Users\toni\Desktop\Eventio\Test\Events\node_modules\ajv\dist\vocabularies\core\id.js:6:15)
at keywordCode (C:\Users\toni\Desktop\Eventio\Test\Events\node_modules\ajv\dist\compile\validate\index.js:454:13)
at C:\Users\toni\Desktop\Eventio\Test\Events\node_modules\ajv\dist\compile\validate\index.js:222:17
at CodeGen.code (C:\Users\toni\Desktop\Eventio\Test\Events\node_modules\ajv\dist\compile\codegen\index.js:439:13)
at CodeGen.block (C:\Users\toni\Desktop\Eventio\Test\Events\node_modules\ajv\dist\compile\codegen\index.js:568:18)
at iterateKeywords (C:\Users\toni\Desktop\Eventio\Test\Events\node_modules\ajv\dist\compile\validate\index.js:219:9)
at groupKeywords (C:\Users\toni\Desktop\Eventio\Test\Events\node_modules\ajv\dist\compile\validate\index.js:208:13)
at C:\Users\toni\Desktop\Eventio\Test\Events\node_modules\ajv\dist\compile\validate\index.js:192:13
at CodeGen.code (C:\Users\toni\Desktop\Eventio\Test\Events\node_modules\ajv\dist\compile\codegen\index.js:439:13)
at CodeGen.block (C:\Users\toni\Desktop\Eventio\Test\Events\node_modules\ajv\dist\compile\codegen\index.js:568:18)

已尝试操作

已安装 @schematics/angular,但不知道如何定位对应的Schema文件,也不清楚如何将文件中的id替换为$id,求解决思路。

项目依赖配置

{
  "private": true,
  "dependencies": {
    "@angular/animations": "^14.0.0",
    "@angular/common": "^14.0.0",
    "@angular/compiler": "^14.0.0",
    "@angular/core": "^14.0.0",
    "@angular/forms": "^14.0.0",
    "@angular/platform-browser": "^14.0.0",
    "@angular/platform-browser-dynamic": "^14.0.0",
    "@angular/router": "^14.0.0",
    "rxjs": "~7.5.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4",
    "@angular/cdk": "^14.1.0",
    "@angular/localize": "^14.0.6",
    "@angular/material": "^14.1.0",
    "@auth0/angular-jwt": "^5.0.1",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^6.1.13",
    "@ionic/cordova-builders": "^7.0.0",
    "@ionic/storage": "^2.3.1",
    "@ng-bootstrap/ng-bootstrap": "^12.1.2",
    "@popperjs/core": "^2.11.5",
    "bootstrap": "^5.1.3",
    "jquery": "^3.6.0",
    "ngx-owl-carousel-o": "^14.0.0",
    "ngx-slick-carousel": "^0.6.0",
    "slick-carousel": "^1.8.1",
    "ts-debounce": "^4.0.0",
    "validate-npm-package-license": "^3.0.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^14.0.5",
    "@angular/cli": "^14.0.5",
    "@angular/compiler": "^14.0.5",
    "@angular/compiler-cli": "^14.0.5",
    "@angular/language-service": "^14.0.5",
    "@ionic/angular-toolkit": "^2.3.3",
    "@types/googlemaps": "^3.43.3",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "codelyzer": "^6.0.0",
    "cordova-android": "^10.1.2",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^4.2.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "execa": "^6.1.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~4.6.4"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {}
    },
    "platforms": [
      "android"
    ]
  }
}

内容的提问来源于stack exchange,提问作者Toni Tonz

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.24 21:06:23