Sage Hassan
Sage Hassan

Reputation: 31

How to fix "Schema Validation error" when building an angular app

i am currently on angular 7.1 and whenever i run ng build to build the project,i get a schema validation error. Please i need help

running ng serve works perfectly without any problem

below is the error log

  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] F:\sageProjects\myriad-app\node_modules\@angular-devkit\core\src\workspace\workspace.js:215:42)
    at MergeMapSubscriber._tryNext F:\sageProjects\myriad-app\node_modules\rxjs\internal\operators\mergeMap.js:69:27)
    at MergeMapSubscriber._next F:\sageProjects\myriad-app\node_modules\rxjs\internal\operators\mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next F:\sageProjects\myriad-app\node_modules\rxjs\internal\Subscriber.js:67:18)
    at MergeMapSubscriber.notifyNext F:\sageProjects\myriad-app\node_modules\rxjs\internal\operators\mergeMap.js:92:26)
    at InnerSubscriber._next F:\sageProjects\myriad-app\node_modules\rxjs\internal\InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next F:\sageProjects\myriad-app\node_modules\rxjs\internal\Subscriber.js:67:18)
    at MapSubscriber._next (F:\sageProjects\myriad-app\node**strong text**_modules\rxjs\internal\operators\map.js:55:26)
    at MapSubscriber.Subscriber.next (F:\sageProjects\myriad-app\node_modules\rxjs\internal\Subscriber.js:67:18)
    at SwitchMapSubscriber.notifyNext (F:\sageProjects\myriad-app\node_modules\rxjs\internal\operators\switchMap.js:86:26)

Upvotes: 0

Views: 5804

Answers (2)

Saif
Saif

Reputation: 434

Try 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.

Upvotes: 2

Sage Hassan
Sage Hassan

Reputation: 31

Thankfully i resolved it by doing the following:

  • on my project folder , i right-clicked and went to properties to uncheck the Read only attribute
  • downloaded and install nodejs from https://ejs.org/en/download/current/
  • i updated angular using ng update @angular/cli @angular/core
  • run npm install if you encounter an error as i did, you will be prompted to run npm audit fix

  • finally i run ng build which worked with no errors/. NB:i executed all commands with windows powershell as an administrator

    Upvotes: 0

  • Related Questions