【问题标题】:How to create ionic 3 projects without downgrading ionic 4 cli如何在不降级 ionic 4 cli 的情况下创建 ionic 3 项目
【发布时间】:2019-03-13 22:09:45
【问题描述】:

我已升级到 ionic 4,但我想在不降级 CLI 的情况下创建 ionic 3 项目,请问我该怎么做?

【问题讨论】:

  • ionic 4 cli 在您创建新项目时询问项目版本。
  • 是的,这是真的,但它不再要求 Cordova 集成
  • 在办公室我的工作笔记本电脑上我有 Ionic 4。我克隆了我的 Ionic 3 存储库,只是做了 npm install 以提取所有依赖项。之后我就可以正常开始工作了。我想只要你的包 json 指向正确版本的 Angular 等 - 你应该能够使用 Ionic 3

标签: ionic-framework ionic3 ionic4


【解决方案1】:

首先使用创建一个新项目

ionic start projectname blank --type=ionic-angular

那么你应该使用:

ionic cordova prepare android

将cordova添加到项目中。

【讨论】:

  • 这个命令有什么作用?它对 OP 有什么帮助?为你的答案添加一些解释!
【解决方案2】:

ionic 启动项目名称选项卡 --type=ionic-angular

【讨论】:

  • 这给了我我需要的东西,但它没有t add the cordova integration, doesnt 甚至不再问了
【解决方案3】:

正如其他答案所述,使用 --type=ionic-angular 是 Ionic 4 CLI 表示“Ionic 3”的方式。这是对此的参考:https://github.com/ionic-team/ionic-cli/issues/3862

如果您运行ionic start --list,它将显示可用的模板和项目类型。对于项目类型,angular 将是 Ionic 4,ionic-angular 将是 Ionic 3,ionic1 实际上命名良好:-)

name     | project type  | description
--------------------------------------------------------------------------------------------------------------------------------
blank    | angular       | A blank starter project
sidemenu | angular       | A starting project with a side menu with navigation in the content area
tabs     | angular       | A starting project with a simple tabbed interface
tabs     | ionic-angular | A starting project with a simple tabbed interface
blank    | ionic-angular | A blank starter project
sidemenu | ionic-angular | A starting project with a side menu with navigation in the content area
super    | ionic-angular | A starting project complete with pre-built pages, providers and best practices for Ionic development.
tutorial | ionic-angular | A tutorial based project that goes along with the Ionic documentation
aws      | ionic-angular | AWS Mobile Hub Starter
tabs     | ionic1        | A starting project for Ionic using a simple tabbed interface
blank    | ionic1        | A blank starter project for Ionic
sidemenu | ionic1        | A starting project for Ionic using a side menu with navigation in the content area
maps     | ionic1        | An Ionic starter project using Google Maps and a side menu

【讨论】:

    猜你喜欢
    • 2018-02-13
    • 2022-08-19
    • 2017-11-06
    • 2019-01-03
    • 1970-01-01
    • 2020-06-29
    • 1970-01-01
    • 2020-09-23
    • 2019-05-18
    相关资源
    最近更新 更多