【问题标题】:Create Ionic project of an older version using Ionic CLI使用 Ionic CLI 创建旧版本的 Ionic 项目
【发布时间】:2020-06-29 20:19:55
【问题描述】:

由于兼容性原因,我需要使用 Ionic 4 而不是 5。如何初始化一个新的 ionic 4 项目?

根据Ionic CLI docs

Use the --type option to start projects using older versions of Ionic.

但是这样做并没有帮助。

HP:project user$ ionic start --list

Starters for @ionic/angular (--type=angular)

name         | description
--------------------------------------------------------------------------------------
tabs         | A starting project with a simple tabbed interface
sidemenu     | A starting project with a side menu with navigation in the content area
blank        | A blank starter project
list         | A starting project with a list
my-first-app | An example application that builds a camera with gallery
conference   | A kitchen-sink application that shows off all Ionic has to offer


Starters for @ionic/react (--type=react)

name         | description
--------------------------------------------------------------------------------------
blank        | A blank starter project
list         | A starting project with a list
my-first-app | An example application that builds a camera with gallery
sidemenu     | A starting project with a side menu with navigation in the content area
tabs         | A starting project with a simple tabbed interface
conference   | A kitchen-sink application that shows off all Ionic has to offer


Starters for Ionic 2/3 (--type=ionic-angular)

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


Starters for Ionic 1 (--type=ionic1)

name     | description
---------------------------------------------------------------------------------------------
tabs     | A starting project for Ionic using a simple tabbed interface
sidemenu | A starting project for Ionic using a side menu with navigation in the content area
blank    | A blank starter project for Ionic
maps     | An Ionic starter project using Google Maps and a side menu

环境

已安装当前 CLI 版本使用

npm i -g @ionic/cli

【问题讨论】:

  • 不是一个好主意,但您可以降级 CLI 以创建项目并再次升级 CLi。

标签: ionic-framework ionic4 ionic-cli


【解决方案1】:
For some reason, making the command all together like this: 
Ionic start myProject tabs --type=angular (which is ionic 4),  doesn't work, it show some errors like this: [ERROR] Network connectivity error occurred, are you offline? which is already been reported to the ionic team yesterday https://github.com/ionic-team/ionic/issues/20795, 

【讨论】:

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