Angular 6 Migration -.angular-cli.json to angular.json

前端 未结 8 1786
北荒
北荒 2020-12-04 16:37

I\'ve upgraded my project to Angular 6, and everything went fine except the conversion of .angular-cli.json file. From the guide I followed, it was said that th

相关标签:
8条回答
  • 2020-12-04 17:10

    Most likely there were errors in one of those commands. For me, I had to run npm install -g @angular-devkit/core first and then run the commands:

    npm install -g @angular/cli
    
    npm install @angular/cli
    

    In the console output of npm install @angular/cli you should see:

    ================================================================================
    The Angular CLI configuration format has been changed, and your existing configuration can
    be updated automatically by running the following command:
    
      ng update @angular/cli
    ================================================================================
    

    Then you obviously should run ng update @angular/cli to finish off the process.

    See the Official Update Guide for additional details.

    0 讨论(0)
  • 2020-12-04 17:12

    Try running "ng update @angular/cli" twice it will update angular-cli.json to angular.json

    UPDATE:

    if getting errors like this:

    ERROR: The specified command update is invalid, for available options see ng-help.

    then you need to run 2 commands as follows

    1. npm install --save-dev @angular/cli@latest.
    2. ng update @angular/cli

    this will automatically create angular.json, delete .angular-cli.json and update karma.conf.js, src/tsconfig.spec.json, package.json, and tslint.json

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