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

前端 未结 17 934
无人共我
无人共我 2021-01-31 01:10
Schema validation failed with the following errors:
  Data path \".builders[\'app-shell\']\" should have required property \'class\'.

Schema validation failed with the          


        
相关标签:
17条回答
  • 2021-01-31 01:15

    Just found this answer from another link,

    npm uninstall @angular-devkit/build-angular
    npm install @angular-devkit/build-angular@0.13.0
    
    0 讨论(0)
  • 2021-01-31 01:16

    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

    0 讨论(0)
  • 2021-01-31 01:17

    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

    0 讨论(0)
  • 2021-01-31 01:19

    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

    0 讨论(0)
  • 2021-01-31 01:20

    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.

    0 讨论(0)
  • 2021-01-31 01:22

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

    • node 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. Ran 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). See here 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

    0 讨论(0)
提交回复
热议问题