secretshardul
secretshardul

Reputation: 1873

Create Ionic project of an older version using Ionic CLI

I need to use Ionic 4 instead of 5 due to compatibility reasons. How can I initialise a new ionic 4 project?

According to Ionic CLI docs

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

But doing this does not help.

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

environment

Had installed current CLI version using

npm i -g @ionic/cli

Upvotes: 2

Views: 2453

Answers (2)

Duane Wagner
Duane Wagner

Reputation: 41

There is no easy way yet. Try making a project folder from the src here: https://github.com/ionic-team/starters/tree/main/angular But, look at the history and search for a point where it was updated to the angular version you are interested in using.
Copy the full SHA for that history item and use it in the link like this: https://github.com/ionic-team/starters/tree/dc48a925b5455e97099858428d2a74cc113bea47/angular Copy the code from the base folder for a plain project and then merge the code from the official/{starter type} folder.

Upvotes: 0

Antonio
Antonio

Reputation: 35

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, 

Upvotes: 0

Related Questions