How to update the Ionic in the existing project?


#3

That’s great idea, thank you! I’ll try this way. But it will be a great deal if we will have a CLI way…


#4

I’m also interested in this topic. Same reason here, I’m developing an app using Ionic 0.9.24 and i will be upgrading to 1.0.0 in the next days. The best references to do this I think are the sections “Breaking changes / Migration guide” in the Changelog

But the task is maybe kinda challenging. The only two possible ways to get this done are

  1. Fix line by line, template by template, from the main one to the rest of starting with the index.html. Introducing once fix at the same time and testing.
  2. Start a new project with the new version and go adding gradually the code, making here each fix.

It isn’t a trivial task if you have used a lot of components (side menus, tabs, headers, scroll contents, lists, cards, etc) all in one app. May be the fastest and most secure option is starting a new project.

What do you think? Thanks in advance,

Cheers


#5

Based on the document:

Updating Ionic

To update to a new version of Ionic, open bower.json and change the version listed there.

For example, to update from version 1.0.0-beta.4 to 1.0.0-beta.5, open bower.json and change this:

"ionic": "driftyco/ionic-bower#1.0.0-beta.4"

To this:

"ionic": "driftyco/ionic-bower#1.0.0-beta.5"

After saving the update to bower.json file, run gulp install.

Alternatively, install bower globally with npm install -g bower and run bower install.


#6

I’ve tried this - “gulp install” , and after installing what seemed like 10000’s of extra plugins, I’ve finally got the point where it runs… but bombs out with…

The version IS the same as current Beta, but I want to get it set up properly before I import my existing code base…
bower cached git://github.com/driftyco/ionic-bower.git#1.0.0-beta.9
bower validate 1.0.0-beta.9 against git://github.com/driftyco/ionic-bower.g
it#1.0.0-beta.9
bower not-cached git://github.com/angular-ui/ui-router.git#0.2.10
bower resolve git://github.com/angular-ui/ui-router.git#0.2.10
bower cached git://github.com/angular/bower-angular.git#1.2.20
bower validate 1.2.20 against git://github.com/angular/bower-angular.git#~1
.2.17
bower cached git://github.com/angular/bower-angular-animate.git#1.2.20
bower validate 1.2.20 against git://github.com/angular/bower-angular-animat
e.git#~1.2.17
bower cached git://github.com/angular/bower-angular-sanitize.git#1.2.20
bower validate 1.2.20 against git://github.com/angular/bower-angular-saniti
ze.git#~1.2.17
bower ENORESTARGET No tag found that was able to satisfy 0.2.10

Additional error details:
No versions found in git://github.com/angular-ui/ui-router.git


#7

Hi,

1.Download latest ionic by using
npm install -g ionic
2. Goto the root of your project and run this command
ionic lib update


#9

This has to be run as an admin: sudo npm install -g ionic


#10
$ ionic lib update

See doc on GitHub


#11

This method doesn’t work on Windows, at least mine. Each time, each CLI version, the lib update causes that corrupted files are installed and manual update must be performed.


#12

Yes, there’s constantly some trouble when updating from the CLI in windows.

For this last update, even the npm install -g ionic didn’t work, I got a warning: “package.json github-url-grom-git@1.1.1 No repository field.”

The manual installation was the only way.


#13

Well, Thats all I did to update my Ionic (which is actually about updating “lib” folder under “www” directory).


Ionic lib update as root user
#14

Hi guys, this is based off a reply I did in another post, but I was unable to successfully use “ionic lib update” to update version 13 to version 14 without doing the below steps. (Before doing the below steps, ionic lib update would always just return beta version 13, which was the current installed for the project).

First off, I changed the bower.json file in the root folder of project / to be ionic version 14:

{
  "name": "flight",
  "private": "true",
  "devDependencies": {
    "ionic": "driftyco/ionic-bower#1.0.0-beta.14"
  }
}

Which worked fine for me, however, the problem I ran into is that version 14 uses a new version of angular which caused me a lot of problems with the second bower.json file in /www/lib/ionic. Instead of trying to resolve all the new versions within that file, I removed the second bower.json file contained within ionic folder, using these commands:

git rm .bower.json
git rm bower.json

So, after modifying the root bower.json and deleting all the bower.json files in the ionic folder, then I navigated back to the root folder and ran ionic lib update. Then, it asked me if I wanted to proceed (yes) and this was the result:

Unable to load ionic lib version information
Are you sure you want to replace /ionic/flight_test_beta14/www/lib/ionic with an updated version of Ionic?
(yes/no): yes
Latest version: 1.0.0-beta.14  (released 2014-12-15)
Downloading: https://github.com/driftyco/ionic-bower/archive/v1.0.0-beta.14.zip
Ionic version updated to: 1.0.0-beta.14

This seems to have worked for me. Note, that there is no bower.json file in the new structure located in the /www/lib/ionic folder, now it is version.json and correctly shows the new version:

{
  "version": "1.0.0-beta.14",
  "codename": "magnesium-mongoose",
  "date": "2014-12-15"
}

Also I had to remove any dependencies that were not compatible with Angular 1.3 in my root bower.json before this would work properly.

I hope this helps anyone struggling to update their project the new version of Ionic Beta 14!


ngMessages not working
Cannot upgrade to beta 14
#15

Thanks!!! that worked for me!!!


#16

hi,gnomeontherun.Could you tell me how to update the file which lasted version through put it into the www/lib directory?Thanks . I feel sorry for my poor english.


#17

The CLI now has a way to update. Just run this command.

ionic lib update

"ECONFLICT Unable to find suitable version for angular" after use "ionic lib update" with CLI
#18

it is not work for created project.


#20

This way to resolve my issue: modify “driftyco/ionic-bower#1.0.0-beta.14” to “driftyco/ionic-bower#1.0.0-rc.0” info in bower.json file which on the second directory of project directory.Then run “ionic lib update” with CLI in the project directory. So thank you! The last,i feel sorry for my poor english. : )


#21

“ionic lib update” actually didn’t work for me.
It did update in the top-level bower.json but the lib under www/lib was still the old one.

“bower update” didn’t help either.
But deleting entirely the www/lib folder and calling “bower install” correctly loaded the latest version.
Not sure what was wrong… I’ll check if “ionic lib update” works next time.


#22

ionic lib update from the root directory worked for me when I upgraded from beta to the main release! :slight_smile:


#23

Strange, if I run ionic lib I get:

Local Ionic version: 1.0.0-rc.0  (<root dir>\<project dir>\www\lib\ionic\bower.json)
Latest Ionic version: 1.0.0-rc.2  (released 2015-03-30)
 * Local version is out of date

If I run ionic lib update I get:

bower ionic#1.0.0-rc.0          cached git://github.com/driftyco/ionic-bower.git#1.0.0-rc.0
bower ionic#1.0.0-rc.0        validate 1.0.0-rc.0 against git://github.com/driftyco/ionic-bower.git#1.0.0-rc.0

If I try the bower route and update the bower.json to rc2 and run ionic lib update I get:

bower ionic#1.0.0-rc.2          cached git://github.com/driftyco/ionic-bower.git#1.0.0-rc.2
bower ionic#1.0.0-rc.2        validate 1.0.0-rc.2 against git://github.com/driftyco/ionic-bower.git#1.0.0-rc.2
bower angular#1.3.13            cached git://github.com/angular/bower-angular.git#1.3.13
bower angular#1.3.13          validate 1.3.13 against git://github.com/angular/bower-angular.git#1.3.13
bower angular-animate#1.3.13    cached git://github.com/angular/bower-angular-animate.git#1.3.13
bower angular-animate#1.3.13  validate 1.3.13 against git://github.com/angular/bower-angular-animate.git#1.3.13
bower angular-sanitize#1.3.13   cached git://github.com/angular/bower-angular-sanitize.git#1.3.13
bower angular-sanitize#1.3.13 validate 1.3.13 against git://github.com/angular/bower-angular-sanitize.git#1.3.13
bower angular#>= 1.0.8          cached git://github.com/angular/bower-angular.git#1.3.15
bower angular#>= 1.0.8        validate 1.3.15 against git://github.com/angular/bower-angular.git#>= 1.0.8
bower                        ECONFLICT Unable to find suitable version for angular

So i need to update angular?? or…?

p.s. this is CLI version 1.3.18

EDIT:

D’OH!! bower update after upping the bower.json to rc2 fixes it, but it looks like after you do that the ionic lib update no longer works…


#24

worked for me, updating from 1.0.0-rc.0 to 1.0.0-rc.4