Is it possible to create Ionic 2 project in Ionic

2019-02-11 13:16发布

问题:

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