Create Ionic project of an older version using Ionic CLI - ionic-framework

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

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,

Related

Create ionic4 project after ionic5 release

As ionic5 is now released, so now when I use this command ionic start myApp blank --type=angular ionic5 app is created, I can confirm this from ionic info command, I am wondering how can I create ionic4 project. The reason behind creating ionic4 project is I have one app in ionic3 and I want to upgrade that app to first in ionic4 and then to ionic5 instead of directly going to latest one because I don't yet know the breaking changes in ionic5 yet and I haven't yet worked on it as well
okay, I got ionic4 app by first creating project with command sudo ionic start myApp blank --type=angular and then when project was created, then using sudo npm i #ionic/angular#^4.0.0 inside app directory to update the ionic info, this can be confirmed both via package.json and ionic info command

Getting a blank project in my ionic view app in ionic 3

I just followed all the instructions on the ionic pro framework i build it but in the ionic view application it is giving me a blank project but in testing my app it is not a blank app please i need a help on this!!

Create an ionic 2 project with ionic 3 cli

How do you create ionic projects with different versions of ionic?
I am able to create an Ionic 1 project by using --type=ionic1 flag in ionic-cli as mentioned here.
But how do we create an Ionic 2 project with ionic-cli 3?
--type=ionic2 doesn't work as mentioned in this thread.
Any kind of help will be appreciated.
Thanks!
You cannot create ionic2 using ionic3 cli
Reason
ionic1 was on angular1x
but angular 2 was not updated version of angular1x but new rewritten for angular and hence ionic updated them self to ionic2 which used angular2
now the angular4 was released it was not rewritten of angular2, it was updated version of angular2.Hence ionic3 was updated and now used angular4.
it means even if you have ionic2 project but you have ionic3 cli installed , yet you can run and compile without any problem.
conclusion. ionic1 is different and ionic2 == ionic3 + some new features such as lazy loading.
Thr is no such need to create ionic2 project
but if you familiar with angular1x and not angular2 you can create ionic1 project with ionic3 cli

How to automatically generate a page-name.module.ts?

So in the newest version of Ionic when we use the generate page command
ionic g page page-name
Ionic creates the page's directory containing the page-name.html, page-name.scss and page-name.ts. It does NOT automatically create the file page-name.module.ts needed for lazy loading and deep links feature.
My question is: Is there any way or any plugin that automatically creates that file for each new page (or for all the existing ones)? Or do we really need to create that file manually for each and every page we create for our project?
As i experience in ionic cli 3.5 while creating a page, the page module was not getting generated. but on ionic cli 3.6 it was generating. need to check on ionic 3.7 which is released today.

Can i run the ionic v1 project when i have ionic CLI 3.0.0

Now i have the latest version of ionic 3.0.0. My ionic version: 3.0.0.
And my ionic info:
global packages:
#ionic/cli-utils : 1.0.0
Ionic CLI : 3.0.0
System:
Node : v7.3.0
OS : macOS Sierra
Xcode : Xcode 8.3.2 Build version 8E2002
ios-deploy : 1.9.0
ios-sim : 5.0.13
Now i have two question in this. I searched , but not able to get the clear. If any one can answer. It will be helpful for many new bie like me.
So,
1.Now i have ionic 3.0.0. Then if i want to open the project in ionic v2. i will give ` ionic start newapp blank --v2 or (--ts_)'. And i will use some updated plugin having in ionic 3.0.0. Does it will work out. or i need to create a seperate project for ionic version 3 ??
Now i have old ionic 1 project that i am still working on. So once i update my ionic to3.0.0. Now what i done is :
ionic start newapp blank --v1 then i copied my old project www folder to this newapp and i replaced it.
My question is. Still can i use angular js1 to code for this project also. And while make ionic release means when i want to put it in my app store. Does any problem will occur. Because i have create this project as --v1.
If yes when i create a new project ionic start newapp blank --v1 its asking me Link this app to your Ionic Dashboard to use tools like Ionic View? y/N : what should i need to do
Please clarify me..thanks in advance
Using the ionic-cli version 3.0 you should be able to work on all versions of ionic projects.
The new cli will create an ionic v3 app by default. If you want to create an ionic v1 app, you need to add --v1. But if you are starting with a new app, I strongly recommend going for v2+.
Depending on the version your ionic app has, you need to add some additional plugins:
#ionic/cli-plugin-ionic-angular – Ionic Angular project plugin that provides useful build tools and generators. (ionic v2+)
#ionic/cli-plugin-ionic1 – Ionic 1 project plugin that has functionality ported from the old CLI.
#ionic/cli-plugin-cordova – Essential for an Ionic/Cordova app.
#ionic/cli-plugin-proxy – For proxying CLI requests through a firewall.
I can't tell you if you need to link your app to the dashboard. If you are using the Ionic services (Push, View, etc), then it makes sense.
That being said, I have experienced quite a few "bugs" or inconsistent behaviour with the new cli, so you might need to downgrade if something doesn't work.
I had this same worry when I updated my Ionic to v3 (CLI 3.1.2). They seem to really be pushing to use their cloud services (obviously, they want to start making some money on it).
When I tried the old v1 command:
ionic build ios
I received:
The build command has been renamed. To find out more, run:
ionic cordova build --help
So, then I tried
ionic covdova build ios
That failed with this:
ionic package build ios
[ERROR] Your project file (./ionic.config.json) does not contain 'app_id'. Run ionic link.
So, after looking around a bit, I used this command and it worked:
ionic cordova build ios --v1
It asked me to install a couple of things, then chugged out a new successful build. All good.
Please use following command as I had trouble with "--v1"
ionic start newapp blank --type=ionic1
As mentioned by #Samuel.
Add Ionic 1 CLI to the devDependency list. Open package.json file in the project directory and add the following line to devDependencies.
"#ionic/cli-framework": "^1.0.0-rc.2"
Example package.json:
Running ionic repair removed package.json and node_modules then, if prompted, run npm audit fix, and then you will be asked to Install #angular/cli?