以下是架构验证失败的错误:数据路径“。builders [‘app-shell’]”应具有所需的属性’class’

错误

以下是原文的汉语翻译:

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.project (/Users/uparupa/hogre/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/workspace/workspace.js:173:42)
    at MergeMapSubscriber._tryNext (/Users/uparupa/hoge/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
    at MergeMapSubscriber._next (/Users/uparupa/hoge/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (/Users/uparupa/hoge/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MergeMapSubscriber.notifyNext (/Users/uparupa/hoge/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
    at InnerSubscriber._next (/Users/uparupa/hoge/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (/Users/uparupa/hoge/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MapSubscriber._next (/Users/uparupa/hoge/node_modules/rxjs/internal/operators/map.js:55:26)
    at MapSubscriber.Subscriber.next (/Users/uparupa/hoge/node_modules/rxjs/internal/Subscriber.js:66:18)
    at SwitchMapSubscriber.notifyNext (/Users/uparupa/hoge/node_modules/rxjs/internal/operators/switchMap.js:86:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! hoge@0.0.0 start: `ng serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the osarchive@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

应对

将angular.json文件中的builder更改为以下内容

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

随后

$ npm install
$ ng update @angular/cli @angular/core
$ npm audit fix

在我的环境下执行之后,问题得到了解决…仅供参考…

广告
将在 10 秒后关闭
bannerAds