问题描述
我已经将项目升级到Angular 6,除了.angular-cli.json
文件的转换之外,一切都很好.在我遵循的指南中,有人说它将自动将其转换.
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 this will convert it automatically.
npm install @ angular/cli
npm install @angular/cli
ng更新@ angular/cli
ng update @angular/cli
但是,情况并非如此,因为我仍然有旧的.angular-cli.json
However, it was not the case as I still have the old .angular-cli.json
有没有办法自动/手动?
Is there a way to do it automatically / manually?
推荐答案
这些命令之一很可能有错误.对我来说,我必须先运行npm install -g @angular-devkit/core
,然后运行以下命令:
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
在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
================================================================================
那么显然您应该运行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.
这篇关于Angular 6迁移-.angular-cli.json到angular.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!