How to update ionic framework applications? - ionic-framework

I have app build with #ionic/angular#5.0, which used #angular#8.
I want to update to current version of ionic (and angular).
How should I do it and in what order (ionic docs say nothing :/ )
ng update #angular/core #angular/cli
npm i -s #ionic/angular

Added more notes to the docs issue you opened. this would make for a good dedicated page. In the mean time, in your case, you're already on the latest Ionic (v5 as of august 2020), so this is more about Angular. Follow their update guide - it's very helpful and tells you exactly what commands to run.
Generally, updating Ionic varies by framework, but for Angular:
npm i #ionic/angular#latest
and do the same for other #ionic/angular packages

Related

Upgrade to Ionic 5 with Angular 9 from Ionic 4 / Angular 7

There is a great tutorial video on the official Ionic YouTube channel which will show you a best-case scenario for upgrading to Ionic 5 and Angular 9.
However for my simple prototype app that I had made last year (just a demo that let me reorder a list) I tried to update but almost immediately came off the rails.
It turned out to be using "#angular/core": "^7.2.2" which broke the app from ionic serve because it was expecting Angular 8.
Then I tried to run the ng upgrade but got hit with incompatible peer dependencies for codelyzer, #ionic/angular-toolkit, and #angular/http.
So I tried to upgrade to Angular 8 first with npm i #angular/core#"~8.x.x" but that failed as it needed npm i zone.js#~0.9.1.
How can I update successfully to the latest and greatest?
So for people coming from angular 7 it seems for this project the correct upgrade commands are:
npm i #ionic/angular#latest
npm i zone.js#~0.9.1
npm i #angular/core#"~8.x.x"
npm i #ionic/angular-toolkit#latest
npm i codelyzer#latest
npm remove #angular/http
ng update #angular/core #angular/cli --allow-dirty
and it finally updated everything. However I did see a warning saying Package not installed: "--allow-dirty". Skipping.
However, then after that I dared to try ionic build and it failed with this error, which got me stuck for another 15 minutes:
zone-flags.ts is missing from the TypeScript compilation.
It seems that the polyfills.ts uses the .ts extension in the include which is breaking the compilation.
I changed this line in polyfills.ts:
import './zone-flags.ts';
To this:
import './zone-flags';
AND IT COMPILED.
But did it ionic serve?
No. No it did not.
The browser showed this in the console:
Error: Angular JIT compilation failed: '#angular/compiler' not loaded!
So after some more searching, I found that if you open main.ts and then add
import '#angular/compiler';
Near the top then all will be right and good with the world once more...
...unless your project then needs the markup breaking changes resolving, but you're on your own for that.

Could not find cordova integration in the default project

following the official getting started tutorial I get the following error when I try to deploy the application in my phone using this command: ionic serve --devapp (it works on browser):
[ERROR] Could not find cordova integration in the default project.
I get this error both on Windows and MacOS.
I'm using Node 6.4.1 and Ionic CLI 4.10.3
Does the official tutorial missing something?
I had the same issue. In fact, with the default project, you have to copy the cordova assets to prepare the native build for mobile.
You can find more info here : Ionic documentation
Try this :
ionic cordova prepare
And then go again with :
ionic serve --devapp
The accepted answer is 100% correct .
But the reason why this occurred for me was that somehow the default was capacitor and not cordova.
so first i ran
ionic integrations disable capacitor
then ran
ionic cordova prepare
which solved my issue

Was Ionic 4 Beta removed from NPM?

Looks like the beta version of Ionic 4 was removed from NPM
https://www.npmjs.com/package/ionic?activeTab=versions
is this correct?
if so is it going to be added Ionic 5.beta?
You might confuse Ionic CLI (i.e. the package you link to) and #ionic/core library, which version 4.0.0-beta.0 was announced in Ionic Blog.

How to keep both ionic 1, 3, version in my system

Initaially i was working with ionic 1.7.6 version with many apps. And by today some how i have changed to version 3.0.0. Now when i open my old projects under package.json i see the version as 3.0.0 instead of 1.7.6. And when i do sudo ionic build android it throws me some error to upgrade the version.
So now i have uninstall the ionic & cordova from my system.
Now i want to keep ionic 1 version 1.7.6 as well as ionic 3 version 3.0.0 how can i do it now.
so when ever i open the ionic 1 project i need to work on angularjs with ionic 1 version.
And when ever i open the project that i have created with version 3 i need to work with latest version of angular is with ionic 3..
please some one expalain me what should i need to do ??
Thank in advance !
I suspect you have installed ionic globally. If you want to run the local/project version of ionic you need to sudo ./node_modules/ionic/ionic ....
This will be the version of ionic as defined in the package.json of the project.
You can tuck this nicely away however using npm scripts (in your package.json):
e.g.
"scripts": {
"ionic": "sudo ./node_modules/ionic/ionic build "
}
Ten simply execute npm run ionic -- android

what are all the packages,plugins,dependencies need for build a ionic 2 app?

I am new to ionic 2 framework and angular 2 framework.Before going to ionic 2,i were studied the basic introduction about ionic 1.
While considering ionic 1 Framework,if i am going to build a app(works on both android and ios)
we need following things to build an app using ionic framework 1(for Example)
Cordova.js
Package bower provides following files for ionic 1 support.
Ionic.bundle.js
Ionic.bundle.min.js
Ionic.js
Ionic.min.js
Ionic-angular.js
Ionic-angular.min.js
Plugins:-
cordova-plugin-console
cordova-plugin-device
cordova-plugin-splashscreen
cordova-plugin-statusbar
cordova-plugin-whitelist
ionic-plugin-keyboard
On my point of view, from my search results,i were found following for ionic 2 support.
TypeScript
Angular 2
Ionic 2
Could any one tell me,what are the packages,plugins,dependencies need for build an ionic2 mobile app?
First install ionic and cordova
>_ npm install -g ionic cordova
Then download one of the ionic 2 templates.
>_ npm ionic start testapp sidemenu --v2
Then just check the package.json
its all outlined here https://ionicframework.com/docs/v2/setup/installation/