angular - 错误 : Schema validation failed with the following errors: Data path ".builders[' app-shell' ]"should have required property ' class'

标签 angular

我是 Angular 的新手,我最近从 GitHub 克隆了一个项目,当我尝试使用“ng serve”运行它时。它向我显示如下错误。

Schema validation failed with the following errors:
  Data path ".builders['app-shell']" should have required property 'class'.
Error: Schema validation failed with the following errors:
  Data path ".builders['app-shell']" should have required property 'class'.
    at 
MergeMapSubscriber._registry.compile.pipe.operators_1.concatMap.validatorResult [as project] (C:\Users\dell\hotel-panel-av7\node_modules\@angular\cli\node_modules\@angular-devkit\core\src\workspace\workspace.js:215:42)
    at MergeMapSubscriber._tryNext (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\operators\mergeMap.js:69:27)
    at MergeMapSubscriber._next (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\operators\mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\Subscriber.js:67:18)
    at MergeMapSubscriber.notifyNext (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\operators\mergeMap.js:92:26)
    at InnerSubscriber._next (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\Subscriber.js:67:18)
    at MapSubscriber._next (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\operators\map.js:55:26)
    at MapSubscriber.Subscriber.next (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\Subscriber.js:67:18)
    at SwitchMapSubscriber.notifyNext (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\operators\switchMap.js:86:26)
    at InnerSubscriber._next (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\Subscriber.js:67:18)
    at C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\util\subscribeTo.js:17:28
    at Object.subscribeToResult (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\util\subscribeToResult.js:10:45)
    at SwitchMapSubscriber._innerSub (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\operators\switchMap.js:65:54)
    at SwitchMapSubscriber._next (C:\Users\dell\hotel-panel-av7\node_modules\rxjs\internal\operators\switchMap.js:55:14)

关于我当前 Angular 信息。

Angular CLI: 7.3.1 Node: 10.16.3 OS: win32 x64 Angular: 7.2.15 ... animations, common, compiler, core, forms, http ... platform-browser, platform-browser-dynamic, platform-server ... router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.0
@angular-devkit/build-angular     0.803.0
@angular-devkit/build-optimizer   0.803.0
@angular-devkit/build-webpack     0.803.0
@angular-devkit/core              7.3.1
@angular-devkit/schematics        0.0.40
@angular/cdk                      7.3.7
@angular/cli                      7.3.1
@angular/compiler-cli             7.2.4
@angular/language-service         7.2.4
@angular/material                 7.3.7
@angular/pwa                      0.12.4
@ngtools/json-schema              1.1.0
@ngtools/webpack                  8.3.0
@schematics/angular               7.2.4
@schematics/schematics            0.0.10
@schematics/update                0.13.1
rxjs                              6.3.3
typescript                        3.1.6
webpack                           4.39.2

我的 Package.json

        {
          "name": "AboutStaysHotelPanel",
          "version": "1.0.0",
          "scripts": {
            "ng": "ng",
            "start": "ng serve",
            "build": "ng build",
            "test": "ng test",
            "lint": "ng lint",
            "e2e": "ng e2e"
          },
          "private": true,
          "dependencies": {
            "@angular-devkit/schematics": "0.0.40",
            "@angular/animations": "^7.2.4",
            "@angular/cdk": "^7.3.2",
            "@angular/common": "^7.2.4",
            "@angular/compiler": "^7.2.4",
            "@angular/core": "^7.2.4",
            "@angular/forms": "^7.2.4",
            "@angular/http": "^7.2.4",
            "@angular/material": "^7.3.2",
            "@angular/platform-browser": "^7.2.4",
            "@angular/platform-browser-dynamic": "^7.2.4",
            "@angular/platform-server": "^7.2.1",
            "@angular/pwa": "^0.12.4",
            "@angular/router": "^7.2.1",
            "@angular/service-worker": "^7.2.4",
            "@ng-bootstrap/ng-bootstrap": "1.0.0-beta.5",
            "@types/moment": "^2.13.0",
            "@types/socket.io-client": "^1.4.32",
            "amazing-time-picker": "^1.5.3",
            "angular-draggable-droppable": "^1.1.1",
            "class-transformer": "^0.1.9",
            "core-js": "^2.5.7",
            "fs-extra": "^4.0.3",
            "hammerjs": "^2.0.8",
            "http-status-codes": "^1.3.0",
            "moment": "^2.24.0",
            "ng-pick-datetime": "^7.0.0",
            "rxjs": "~6.3.3",
            "rxjs-compat": "^6.4.0",
            "socket.io-client": "^2.1.1",
            "tslib": "^1.9.0",
            "web-animations-js": "^2.3.1",
            "zone.js": "~0.8.26"
          },
          "devDependencies": {
            "@angular-devkit/build-angular": "^0.803.0",
            "@angular-devkit/core": "^7.3.1",
            "@angular/cli": "^7.2.4",
            "@angular/compiler-cli": "^7.2.4",
            "@angular/language-service": "^7.2.4",
            "@types/jasmine": "~3.3.8",
            "@types/jasminewd2": "~2.0.3",
            "@types/node": "^10.12.26",
            "codelyzer": "~4.5.0",
            "jasmine-core": "~3.3.0",
            "jasmine-spec-reporter": "~4.2.1",
            "karma": "^4.3.0",
            "karma-chrome-launcher": "~2.2.0",
            "karma-coverage-istanbul-reporter": "~2.0.1",
            "karma-jasmine": "~2.0.1",
            "karma-jasmine-html-reporter": "^1.4.0",
            "protractor": "~5.4.0",
            "ts-node": "~8.0.2",
            "tslint": "~5.12.1",
            "typescript": "3.1.6"
          }
        }

最佳答案

改变自

"@angular-devkit/build-angular": "^0.803.0",

"@angular-devkit/build-angular": "^0.13.9",

将解决您的问题。

关于angular - 错误 : Schema validation failed with the following errors: Data path ".builders[' app-shell' ]"should have required property ' class',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57687243/

相关文章:

javascript - 保留点击 Angular ngFor的背景边框

css - 更改 Mat 表单字段输入颜色

angular - 同时运行多个应用程序?

javascript - 在 Angular 中动态加载组件

javascript - 在 Angular2 项目中集成 Treant-js

javascript - 从共享消息服务触发事件以更改组件的内容

javascript - Angular 7 - 生产模式 : I can't navigate through page using the tab key

angular - 如何使用angular 6在函数中传递动态模板引用变量

angular - 如何计算从现在到 Angular 中声明的一天之间的总天数?

angular - 如何使用 Rx 在 Angular 2 中实现可拖动的 div