简体   繁体   English

Angular 从 5 升级到 6 - Angular.json 未创建

[英]Angular upgrade from 5 to 6 - Angular.json not created

I'm following the official guide to upgrade angular app to version 10, currently while try to upgrade to CLI version 6 as per the update.angular.io我正在按照官方指南将 angular 应用程序升级到版本 10,目前正在尝试根据更新升级到 CLI 版本6。angular.ZF98ED07A4D5F50F7DE1410D905F1477F

Make sure you are using Node 8 or later Update your Angular CLI locally, and migrate the configuration to the new angular.json format by running the following:确保您使用的是 Node 8 或更高版本 在本地更新您的 Angular CLI,并通过运行以下命令将配置迁移到新的 angular.json 格式:

npm install @angular/cli@6
ng update @angular/cli@6

I've run the following code but still i could see.angular-cli.json file instead of angular.json file.我已经运行了以下代码,但我仍然可以看到.angular-cli.json 文件而不是 angular.json 文件。

Below is current cli version updated to version 6 except for couple of warning related to peer dependency didnt get any error while updating CLI.以下是更新到版本 6 的当前 cli 版本,除了与对等依赖相关的几个警告在更新 CLI 时没有出现任何错误。

在此处输入图像描述

This did the trick !!这成功了! @Andrew Allen but the second most voted answer worked in my case => you can automatically update your existing angular-cli.json file to angular.json file by using the below command provided that you are on v6.xx or greater of angular cli command line tool. @Andrew Allen but the second most voted answer worked in my case => you can automatically update your existing angular-cli.json file to angular.json file by using the below command provided that you are on v6.xx or greater of angular cli命令行工具。

**ng update @angular/cli --from=1.7.4 --migrate-only**

In the above command 1.7.4 is the previous cli version you were using.在上面的命令中,1.7.4 是您之前使用的 cli 版本。 The --migrate-only flag makes sure that it will only perform a migration but does not update the installed version. --migrate-only 标志确保它只会执行迁移但不会更新已安装的版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM