Is it possible to create Ionic 2 project in Ionic 3 CLI

我怕爱的太早我们不能终老 提交于 2019-12-30 05:27:07

问题


When I do this, I get the message below:

Command :

ionic start blank myapp --v2

Error :

[ERROR] Sorry! The --v1 and --v2 flags have been removed. Use the --type option. (ionic start --help) For Ionic Angular projects, try ionic start blank myapp --type=ionic-angular

My Ionic CLI version is :

ionic -v
3.3.0

回答1:


Update 2 : You can no longer create Ionic 2 project in Ionic 3 CLI.

As Ionic 2 was not updated & is rewritten using Ionic 3, which uses Angular 4.

So if you create new Ionic project it will use Ionic 3 by default.


Update 1 : More Info Available Here

With the updates few changes are done in syntax as well :

To create a new project : (You have 3 templates available with Ionic i.e. blank, tabs, sidemenu)

  1. ionic start {{AppName}} {{TemplateName}} ==> Latest Ionic codebase project
  2. ionic start {{AppName}} {{TemplateName}} --type ionic1 ==> Ionic v1 project

Yes, You can check this link out

ionic start [app-name] [template] --type=ionic1

ionic start [app-name] [template] --type=ionic2

ionic start [app-name] [template] --type=ionic-angular

I have Ionic -v 2.2.2 right now so couldn't test it, so please try and let me know ;)




回答2:


You don't have to specify --v2 for an Ionic 2 project because an Ionic 3 project is just an Ionic 2 project with some new features such as lazy loading and adoption of Angular 4 instead of Angular 2 .Just like Angular 2 and 4 are the same framework ,Ionic 2 and 3 are the same also




回答3:


You can check in

ionic start --list

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


来源:https://stackoverflow.com/questions/44366936/is-it-possible-to-create-ionic-2-project-in-ionic-3-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!