我是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 CLI:7.3.1 节点:10.16.3 操作系统:win32 x64 角度:7.2.15 ...动画,通用,编译器,核心,表格,http ...平台浏览器,平台浏览器动态,平台服务器 ...路由器,服务人员
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"
}
}
答案 0 :(得分:1)
更改自
"@angular-devkit/build-angular": "^0.803.0",
到
"@angular-devkit/build-angular": "^0.13.9",
将解决您的问题。