Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

angular

Schema validation failed with the following errors:
  Data path ".builders['app-shell']" should have required property '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._registry.compile.pipe.operators_1.concatMap.validatorResult [as project] (D:\repo\beauty-velvettes-web\node_modules\@angular\cli\node_modules\@angular-devkit\core\src\workspace\workspace.js:210:42)
    at MergeMapSubscriber._tryNext (D:\repo\beauty-velvettes-web\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:65:27)
    at MergeMapSubscriber._next (D:\repo\beauty-velvettes-web\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:55:18)
    at MergeMapSubscriber.Subscriber.next (D:\repo\beauty-velvettes-web\node_modules\@angular\cli\node_modules\rxjs\internal\Subscriber.js:64:18)
    at MergeMapSubscriber.notifyNext (D:\repo\beauty-velvettes-web\node_modules\@angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:84:26)
    at InnerSubscriber._next (D:\repo\beauty-velvettes-web\node_modules\@angular\cli\node_modules\rxjs\internal\InnerSubscriber.js:25:21)
    at InnerSubscriber.Subscriber.next (D:\repo\beauty-velvettes-web\node_modules\@angular\cli\node_modules\rxjs\internal\Subscriber.js:64:18)
    at MapSubscriber._next (D:\repo\beauty-velvettes-web\node_modules\@angular\cli\node_modules\rxjs\internal\operators\map.js:52:26)
    at MapSubscriber.Subscriber.next (D:\repo\beauty-velvettes-web\node_modules\@angular\cli\node_modules\rxjs\internal\Subscriber.js:64:18)
    at SwitchMapSubscriber.notifyNext (D:\repo\beauty-velvettes-web\node_modules\@angular\cli\node_modules\rxjs\internal\operators\switchMap.js:77:26)
like image 328
Princeton Avatar asked Jun 11 '19 11:06

Princeton


4 Answers

Try to update the package.json file so that "@angular-devkit/build-angular": "^0.800.1" reads "@angular-devkit/build-angular": "^0.12.4"

Then run npm install in the command line.

Reference: https://stackoverflow.com/a/56537342

like image 74
Renato Pradebon Avatar answered Nov 16 '22 01:11

Renato Pradebon


This worked for me.

npm uninstall @angular-devkit/build-angular

npm install @angular-devkit/[email protected]
like image 60
Johnbosco Egwuagu Avatar answered Nov 16 '22 01:11

Johnbosco Egwuagu


Most of the answers are correct in stating that this occurs either because of a mismatch between:

  • Nodejs version and Angular version

OR

  • @angular-devkit/build-angular version and angular version

Also, this issue is most likely to occur if you either:

  1. upgraded/downgraded Nodejs version (which is no longer compatible with the angular version)

  2. Upgraded Angular version

  3. Run npm audit fix

For 1, check the Nodejs version support needed here: https://angular.io/guide/setup-local and check the installed version. If you are using the latest version of angular, you should be able to make it work with the latest version of Nodejs.

For 2, did you follow instructions here: https://update.angular.io/ ? If yes, and still have issues, look for any issues already created or create an issue here: https://github.com/angular/angular/issues

For 3, npm audit fix updates the @angular-devkit/build-angular version to a higher version because @angular-devkit/build-angular does not follow proper versioning (major releases still update only the minor version). Check the link below to check the compatible version for your Angular version: https://www.npmjs.com/package/@angular-devkit/build-angular?activeTab=versions Use the correct version and the issue will be fixed.

P.S: This is a good read about angular versioning: https://angular.io/guide/releases

like image 25
Sterex Avatar answered Nov 16 '22 03:11

Sterex


Try to update @angular/core using ng update @angular/cli @angular/core

like image 18
Arasu Mani Avatar answered Nov 16 '22 01:11

Arasu Mani