Ionic lib version VS ionic app version

Hello everybody,
I don’t understand the difference between the Ionic Lib version, the one that I can find insert in the terminal

ionic -v

and the ionic version in the app, the one that is in the bower.json file.

Why are they different?

And also if I want to be sure to have my app with the leatest version of ionic I do this first

sudo npm install -g ionic

and then in the app root

ionic lib update

I assume that the first command update the Ionic version of npm and the second update the library in my app www/lib. But reading from the ionic-cli on github I don’t understand what this is for

bower update

and when or if I have to use it.

Thanks a lot for helping!

you can build apps with ionic without using the cli --> like using only the framework sources and push your project to phonegap build. So you do not need all the cli stuff.

bower is a packaging tool for websites and so you can add dependencies to your project.
It works like nodes npm.

Instead of maintaining the used libs by hand (copy the sources to your lib folder) and pushing in your git- or svn repo, you add bower.json to your project add the required libs --> run bower install and all deps are installed in bower_components folder --> easy.

To use bower you need node and npm. so in the last time most libs are also available via npm. So maybe you only need your package.json.

Hi Bengtler and thank you for replying.
CLI is also using bower, right? So which are the pros and cons?
I mean which way do you suggest, CLI or bower?
thanks again.

if you are using cli --> use the cli command because it copies all files to www/lib/ionic … and so on.

if you are running bower update it will create a bower_components folder and put the sources in there i think.
I have never tried it :smiley:

I did, but bower update didn’t create the bower_components folder, this because in the bowerrrc file is declared the path.

Infact if you launch

bower list --path

you will see the correct path pointing to the www/lib.

okay then it really does not matter :smile:

all in all i would use the cli command^^