133
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)
Youcef LAIDANI
  • 55,661
  • 15
  • 90
  • 140
Princeton
  • 1,461
  • 2
  • 6
  • 3
  • Does this answer your question? [Ionic problem: \[ng\]Schema validation failed with the following errors:\[ng\]Data path".builders\['app-shell'\]"should have required property 'class'](https://stackoverflow.com/questions/56506473/ionic-problem-ngschema-validation-failed-with-the-following-errorsngdata-p) – Jerry Jan 15 '20 at 06:17

17 Answers17

194

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

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Renato Pradebon
  • 2,073
  • 2
  • 9
  • 7
60

This worked for me.

npm uninstall @angular-devkit/build-angular

npm install @angular-devkit/build-angular@0.13.0
Prince Vegeta
  • 719
  • 6
  • 21
26

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

xmlParser
  • 1,903
  • 4
  • 19
  • 48
Sterex
  • 1,026
  • 1
  • 13
  • 29
18

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

Oleksii Filonenko
  • 1,551
  • 1
  • 17
  • 27
Arasu Mani
  • 189
  • 2
12

Angular Cli 8 support Node Js 10.9+. After update Node.js to 10.16 works fine.

  • Yes, that happened to me because I used NVM to switch to version 8, and I forgot to switch back to version 10, and I was surprisingly getting this error! – Mohammad Kermani Oct 21 '19 at 09:21
12

Just found this answer from another link,

npm uninstall @angular-devkit/build-angular
npm install @angular-devkit/build-angular@0.13.0
Tadele Ayelegn
  • 4,126
  • 1
  • 35
  • 30
8

Update @angular-devkit/build-angular to "^0.13.9" . Then run npm install and after that, run npm serve.

Specs:

Angular: 7.2.15
Angular CLI: 7.3.9
Node: 11.2.0
OS: darwin x64

  • Did you mean `ng serve`? – melike Aug 24 '20 at 15:17
  • Not exactly, @melikesahin, 'ng serve' could work on a different way on old angular versions. 'npm install' and 'npm serve' have worked well on Angular: 7.2.15 and Node11 in order to getting rid of the errors above mentioned. If you are considering to give 'ng serve' a try, please share the outcome. Thanks – Mr Pencilwoods Nov 09 '20 at 17:41
8

Below worked for me.

> 1. npm uninstall @angular-devkit/build-angular 

> 2. npm install @angular-devkit/build-angular@0.13.0

if we use

AVOID: npm audit fix -f

it may create problem, so dont use it.

Community
  • 1
  • 1
Ankur Garg
  • 151
  • 2
  • 2
3

What i did was to uninstall and install the "^0.13.0". I confirm/ support this last answer. It worked for me as well. I had uninstall version "^0.800.0" and installed the "^0.13.0". rebuild your project it will work fine.

C. improve
  • 31
  • 1
3

I got the same error when upgraded angular from 6 to 8.

Simple update angular cli to latest version & node version to 10+.

1) Visit this link to get the latest node version. Angular 8 requires 10+.
2) Execute npm i @angular/cli@latest to update cli.


This is what I have currently

enter image description here

Pranjal Successena
  • 907
  • 1
  • 11
  • 24
3

This is worked for me

  1. npm uninstall @angular-devkit/build-angular
  2. npm install @angular-devkit/build-angular@0.13.0
2

I have to say, if you don't want to change anything in package.json file, try to update your Node.js version to latest. (currently 12.13.1 LTS)

Ted Corleone
  • 843
  • 1
  • 8
  • 16
2

I got this issue when installing Bootstrap.

The following commands are what worked for me:

npm uninstall @angular-devkit/build-angular

npm install @angular-devkit/build-angular@0.13.0
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
1

This will do the trick for you:

  1. Update your angular cli by running the command ng update @angular/cli @angular/core
  2. Run or build your project by running the commands ng s or ng build respectively.
Mickael B.
  • 4,755
  • 4
  • 24
  • 48
tonderaimuchada
  • 215
  • 2
  • 6
0
  1. Opened package.json
  2. Changed "@angular-devkit/build-angular": "^0.800.0" to "@angular-devkit/build-angular": "^0.10.0" or changed Changing from "@angular-devkit/build-angular": "^0.802.1" to "@angular-devkit/build-angular": "^0.13.9"
  3. Run npm install
  4. Run ng serve

The original version can be diferent, but is necessary change it at 0.10.0 or 0.13.9 version that fix the problem

0
  1. open cmd from current project
  2. npm uninstall @angular-devkit/build-angular
  3. npm install --save-dev @angular-devkit/build-angular
Ramu
  • 11
  • 2
0

This worked for me:

In package.json

Changed "@angular-devkit/build-angular": "^0.800.0" --> "@angular-devkit/build-angular": "^0.10.0" Then:

 npm install
 ng serve

Specs:

Angular CLI: 6.1.5 Node: 10.15.3 OS: win32 x64 Angular: 6.1.9

Doga Ozdemir
  • 89
  • 1
  • 12