How to install Ionic framework V5 - ionic-framework

I installed Ionic framework with npm.
npm install -g #ionic/cli
The installed version is 6.2.1, but in my work they using the version 5. How i can install the version 5 ?

6.2.1 is the version of the installed Ionic CLI. This is NOT the Ionic Framework version.
To check the Ionic Framework version of a project, open package.json and look for the version of #ionic/angular. It should be something like this: "#ionic/angular": "^5.0.5".
Also, the versions of the #ionic-native/* plugins would be 5 or greater.
To sum it up, if you are about to contribute to an Ionic 5 project, installing the latest version of the Ionic CLI is enough. When setting up the project on your machine, running npm install should install all the required dependencies, including Ionic 5.

Related

Ionic cli 4 but ionic project is on 5

So I'm trying to create a new ionic 4 project, I installed the cli version 4
Cli version:
ionic -v command shows this line
CLI 4.12.0
but once I created the project and checked package.json of the project I found this line :
"#ionic/angular": "^5.0.0",
this is a little bit confusing, but this means that my project runs under ionic 5 ?
Thank you.
The cli has nothing to do with the #ionic/angular version. You can use the latest cli version, but install the #ionic/angular version you'd like, doing this:
npm i #ionic/angular#YOUR.VERSION.NUMBER
You can pick whatever version you'd like from here. Just go to Versions tab.
edit: you may want to do this before downgrading if you don't start a fresh install:
npm rm #ionic/angular --save

ionic2: how to upgrade to new ionic version in the same project?

I'm using ionic version 3.9.2, I installed
npm install #ngx-translate/core #ngx-translate/http-loader --save
and followed the instruction here:
ngx-translate
But i got this error:
Cannot find the '#angular/common/http'
and after search I found that this problem is because of my Ionic version.
So I want to upgrade my Ionic version in my project, what should i do?
The problem is not your ionic version. The problem is that the current version of http-loader uses HttpClient which is only supported in Angular versions greater than 4.3. The current version of ionic is on Angular version 4.1.3.
How to fix it? Install the last version of http-loader with the old Http client like this:
npm install #ngx-translate/http-loader#0.1.0 --save
Here is the github issue for that topic.

Ionic 2 & Ionic 1 work on different Node Versions

I was having some major build issues with Ionic 1.7.14 on NodeJS v6. Here you can see the problem and some of the solution that people offered me.
ionic.project has been renamed to ionic.config.json, please rename it.
For the past 6 months I have been working and two Ionic 1 Apps. earlier last month I began to work with Ionic 2. So I installed it via npm.. It all seem well I was working on Ionic 2 apps but did not quite connect the dots as to why all of the sudden I could not build anything on my past Ionic 1 apps.
FIRST SOLUTION:
I re-install Ionic 1.7.14 and I downgraded from Node 6.0 to Node 4.4.4 - voila! It was working once again! Ionic 1 was building and the CLI understood all my commands.. No more errors.
THE CONSEQUENCES:
I had to always make sure I was using Node 4.4.4 whenever I wanted to work on Ionic 1.7.x apps.. I use NVM so a simple nvm use 4.4.4 would do the trick.
But when I tried to work on Ionic 2 apps I realized that Ionic 2 was no longer installed and there for had to be re-installed, again. So I did..
RE-OCCURING ISSUE:
After re-installing Ionic 2, working a bit on that app then moving on to continue working on my other Ionic 1 app I realized that when I tried to run ionic serve the CLI gave me some errors which led me to believe I did not have ionic 1 installed.. WTH!? Here we go again.. re-install Ionic 1 version 1.7.x
Later I tried to ionic serve an Ionic 2 app and gulp was not running the build.. It serve the app to the browser but none of my code was being built and implemented into the app. I then realized that the CLI was not running my commands as Ionic 2 but Ionic 1.. What now? You guessed it. I had to re-install Ionic 2
THE CONNECTION between Ionic and Node versions
So yes, It took me a while to make the connection and I still don't quite understand why this is happening but I've found out that I do not need to repeatedly install Ionic versions as I wish to use them.. I just have to switch between Node Versions instead.
Ionic 2 --> works with Node 6.x
Ionic 1 --> works with Node 4.4.4
As long as I am using the respective Node Version with each I have no issues. BUT is this practical? Is there something wrong with my installs and file paths? I am curious if anyone has the same issue.
The following worked for me, not sure if all the steps are necessary.
I've followed these tips:
https://www.abeautifulsite.net/how-to-upgrade-or-downgrade-nodejs-using- npm
https://forum.ionicframework.com/t/ionic2-cli-doesnt-run-gulp-tasks-on-i
onic-serve/49085/6
Your system information:
Cordova CLI: 6.3.1 Gulp version: CLI version 3.9.1 Gulp local:
Local version 3.9.1 Ionic Framework Version: 1.0.0-rc.0 Ionic CLI
Version: 2.1.0 Ionic App Lib Version: 2.1.0-beta.1 ios-deploy version:
1.8.5 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v4.4.4 Xcode version: Xcode 8.0 Build version 8A218a
I think the critical parts are:
Edit the gulpfile.js by adding gulp.task('serve:before', ['default']);
npm install --save-dev gulp-sass#2 (sudo if necessary)
downgrade node to v4.4.4 (big question mark about this step)
npm --production=false install (sudo if necessary)
Update to latest ionic CLI and just rename ionic.project to ionic.config.json... when you 'serve' for the first time, accept suggested installations.
For me it worked right away on the Node 7.7.1,
but with Node 8.1.4 I had to:
1. install Python (add PYTHON env variable)
///navigate to ionic 1 project
2. npm install node-gyp --save
3. npm install bcrypt --save
4. npm install node-sass --save
5. npm rebuild node-sass
6. npm install --save #ionic/cli-plugin-ionic1
// ionic serve
I hope it helps...

update to the latest ionic version

after ionic team has officially released ionic 1.2 versions
I checked
ionic -v
command to get my current version and I found it 1.7.12, then I did
npm install -g ionic
hopefully to update my current version and it just still on the previous version 1.7.12, so what is just the command I have to run to get the ionic 1.2 instead of ionic 1 which I already have now?
It is not a bug in npm, the 1.7.12 version that is shown when you run:
ionic -v
1.7.12
is the ionic-cli version, the command line utility, you can find it here: https://www.npmjs.com/package/ionic
The ionic 1.2 version that you are expecting, is the ionic framework version: http://code.ionicframework.com/# latest is 1.2.4 - Copenhagen
If you want to check the framework version that your app is running, go to your app directory and type:
ionic lib
Local Ionic version: 1.2.4 (<path>/myApp/www/lib/ionic/version.json)
Latest Ionic version: 1.2.4 (released 2016-01-08)
* Local version up to date
It may be bug with npm.
First Uninstall ionic and cordova using
npm uninstall cordova ionic
Then update node and npm
Install cordova and ionic
npm install -g cordova ionic
Check the version.
you can always run
sudo npm uninstall -g ionic && sudo npm install ionic

what is the latest version of ionic build 1.1.0 or 1.6.4

I installed ionic using the following command:
npm install -g ionic
After navigating to node_modules/ionic folder on my local machine and opening the package.json file, it says that the version is 1.6.4
However the ionicframework.com website says the latest version is
1.1.0 "xenon-xerus"
This is quiet confusing. Can someone clarify
You need to differentiate between the ionic CLI (version 1.6.4) and the ionic lib in your application project (version 1.1.0).
if you type ionic -v you'll get the version of the CLI (command line interface)
if you go into your project folder and type ionic lib you'll get the lib version.
Btw: You update the library with ionic lib update
Latest version: 1.7.8
Run npm install -g ionic to update
check version ----
ionic --version
1.7.8
run following command in terminal/cmd: ionic info that command will give you full details of ionic and Cordova installed in your pc and project.
And then you can use npm install -g ionic for install latest ionic build.