Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why doesn't bower update angular upgrade my angular?

I have angular 1.2.3 and I want to upgrade to 1.2.7

> cat bower.json
...
  "dependencies": {
    "json3": "~3.2.4",
    "jquery": "~1.9.1",
    "es5-shim": "~2.0.8",
    "toastr": "~2.0.1",
    "angular-ui-tinymce": "latest",
    "underscore": "~1.5.2",
    "underscore.string": "~2.3.3",
    "angular-ui-utils": "~0.0.4",
    "angular-dragdrop": "~1.0.5",
    "angular-cookies": "~1.2.3",
    "angular-animate": "~1.2.3",
    "angular-resource": "~1.2.3",
    "angular": "~1.2.3"
  },
  "devDependencies": {
    "angular-mocks": "~1.2.3",
    "bootstrap": "~3.0.1",
    "font-awesome": "~4.0.3",
    "angular-bootstrap-affix": "~0.3.0"
  }
...

I don't know what the following output even means...., what is it doing?

> bower update angular
bower angular#~1.x              cached git://github.com/angular/bower-angular.git#1.2.7
bower angular#~1.x            validate 1.2.7 against git://github.com/angular/bower-angular.git#~1.x
bower angular#>= 1.0.2          cached git://github.com/angular/bower-angular.git#1.2.7
bower angular#>= 1.0.2        validate 1.2.7 against git://github.com/angular/bower-angular.git#>= 1.0.2
bower angular#1.2.3             cached git://github.com/angular/bower-angular.git#1.2.3
bower angular#1.2.3           validate 1.2.3 against git://github.com/angular/bower-angular.git#1.2.3
bower angular#~1.2.3            cached git://github.com/angular/bower-angular.git#1.2.7
bower angular#~1.2.3          validate 1.2.7 against git://github.com/angular/bower-angular.git#~1.2.3
bower angular#~1.x                 new version for git://github.com/angular/bower-angular.git#~1.x
bower angular#~1.x             resolve git://github.com/angular/bower-angular.git#~1.x
bower angular#>= 1.0.2             new version for git://github.com/angular/bower-angular.git#>= 1.0.2
bower angular#>= 1.0.2         resolve git://github.com/angular/bower-angular.git#>= 1.0.2
bower angular#~1.2.3               new version for git://github.com/angular/bower-angular.git#~1.2.3
bower angular#~1.2.3           resolve git://github.com/angular/bower-angular.git#~1.2.3
bower angular#~1.x            download https://github.com/angular/bower-angular/archive/v1.2.8-build.2095+sha.28fc80b.tar.gz
bower angular#>= 1.0.2        download https://github.com/angular/bower-angular/archive/v1.2.8-build.2095+sha.28fc80b.tar.gz
bower angular#~1.2.3          download https://github.com/angular/bower-angular/archive/v1.2.8-build.2095+sha.28fc80b.tar.gz
bower angular#>= 1.0.2         extract archive.tar.gz
bower angular#>= 1.0.2        resolved git://github.com/angular/bower-angular.git#1.2.8-build.2095+sha.28fc80b
bower angular#~1.x             extract archive.tar.gz
bower angular#~1.x            resolved git://github.com/angular/bower-angular.git#1.2.8-build.2095+sha.28fc80b
bower angular#~1.2.3           extract archive.tar.gz
bower angular#~1.2.3          resolved git://github.com/angular/bower-angular.git#1.2.8-build.2095+sha.28fc80b

nothing changed? I'm still on 1.2.3

> git diff
diff --git a/ngapp/app/bower_components/angular/.bower.json b/ngapp/app/bower_components/angular/.bower.json
index dc9d0b6..842a1f3 100644
--- a/ngapp/app/bower_components/angular/.bower.json
+++ b/ngapp/app/bower_components/angular/.bower.json
@@ -11,6 +11,6 @@
     "commit": "b112b099971f4cf016023bdeb00b267e9bf6dfb5"
   },
   "_source": "git://github.com/angular/bower-angular.git",
-  "_target": "~1.2.3",
+  "_target": "1.2.3",
   "_originalSource": "angular"
 }

> bower --version
1.2.8

Am I missing something?

> bower info angular
.... shows all versions including 1.2.7 and 1.2.8-builds as well
like image 829
Homan Avatar asked Jan 09 '14 19:01

Homan


People also ask

How do I upgrade to the latest angular version?

1 Choose the Current version Angular and the version you wish to upgrade 2 Select the App Complexity as Advanced 3 Choose other dependencies 4 Choose your package manager 5 Click on Show me how to update

Why is angular material update not working?

Angular material update: It gives errors in some versions of angular material when running update scripts because of the update scripts do not run smoothly in some versions. What I did is updating material after getting everything done. So when I finish with all other updates, I just ran ng update @angular/material.

What is an upgradeable component in AngularJS?

An example of an upgradeable component is one that just has a template and a controller: You can upgrade this component to Angular using the UpgradeComponent class. By creating a new Angular directive that extends UpgradeComponent and doing a super call inside its constructor, you have a fully upgraded AngularJS component to be used inside Angular.

What is the latest version of angular in NPM?

This is where the first issue rears its head — While the NPM environment shows the latest version (7.x.x), generating a new project will use the old version (1.x.x) we just removed earlier. So when we generate a new project, we end up getting an older version of the angular core, and other packages.


1 Answers

I think your dependencies are preventing you from updating angular in isolation. E.g., look at bower_components/angular-route/bower.json. You will see a specific version of angular listed as a dependency ("1.2.3") and not a ~/"reasonably close" specifier" ("~1.2.3"). So you are trying to update just angular, but the farthest that bower can take your angular is the current version since you have other packages that depend on exactly that version.

If you do bower update then bower will have the opportunity to update all your packages, including angular-route and other packages that are holding angular back. The updates to these packages will now allow bower to update angular while satisfying dependencies. Also, I think if you identified all those packages depending on a specific angular version (you can see dependencies with bower list) and passed them as arguments like bower update angular angular-mocks angular-resource angular-route angular-sanitize... then bower could also perform the update.

like image 132
Carl G Avatar answered Oct 30 '22 22:10

Carl G