bower update momentjs not working - bower

> bower list
momentjs#2.2.1 (2.5.1 now available)
I go to change my bower.json to
{
"version": "0.0.0",
"dependencies": {
"momentjs": "~2.5.1",
...
And then run
> bower cache clean
> bower update momentjs
bower installing momentjs#2.2.1
Why am I getting 2.2.1 and not 2.5.1? Have I misunderstood some basics here?

The help page states that the update command:
Updates installed packages to their newest version according to bower.json
~ will only lookup patch versions in the current minor version range ("prereleases") e.g. 1.2.3 => 1.2.7.
To update the minor version, e.g. 1.2.3 = > 1.3.5, use bower install <package> instead.

Related

Bower install downgrades my package

Every time I install a new bower package on my Ember CLI pack, I got
Missing bower packages:
Package: ember
* Specified: 1.11.0
* Installed: 1.10.0
then I run bower install ember#1.11.0.
Unable to find a suitable version for ember, please choose one:
1) ember#1.10.0 which resolved to 1.10.0 and is required by test-addon
2) ember#>= 1.8.1 < 2.0.0 which resolved to 1.11.0 and is required by ember-data#1.0.0-beta.16
3) ember#> 1.5.0-beta.3 which resolved to 1.11.0 and is required by ember-resolver#0.1.15
4) ember#>=1.4 <2 which resolved to 1.11.0 and is required by ember-cli-shims#0.0.3
5) ember#1.11.0 which resolved to 1.11.0Prefix the choice with ! to persist it to bower.json
I choose 5 (Why this hassle if I explicit added the desired version), then it works again.
But next time if I install a new bower package, I have to do it again.
node 0.12.1
bower 1.3.12
emvber cli 0.2.2
You may use -F flag to force to use latest version:
bower install -F
(see docs)
In this case bower didn't asking anything about versions.

How to bower install the latest footable release?

I'm installing plugins using bower, but bower only downloads Footable v2.0.1, not the latest release of v2.0.1.5.
I've tried:
bower install --save-dev footable
bower install --save-dev footable#2.0.1.x
Both these download v2.0.1, I want the latest tagged release of v2 (v2.0.1.5).
Using #2.0.1.x also gave the error "ENORESTARGET: Tag/Branch 2.0.1.x does not exist".
Bower package versions should follow semantic versioning.
In short, a valid semantic version is in the form of MAJOR.MINOR.PATCH.
2.0.1.5, for example, is not a valid semantic version.
You can get a list of available versions for a package by running the following command:
bower info footable
For footable you the results are:
Available versions:
- 2.0.1
- 2.0.0
- 0.5.0
- 0.1.0

How to get Bower to point to the latest version?

If you search for mjolnic on Bower, you'll see there's a mjolnic-bootstrap-colorpicker repo. The repo has a bower.json pointing to v2.0.0-rc, but when you bower install mjolnic-bootstrap-colorpicker, you get a much older version.
How can I make it so bower defaults to installing the latest version?
"dependencies": {
"mjolnic-bootstrap-colorpicker": "latest"
}
into your bower json
more information here : How to install latest (untagged) state of a repo using bower?

Upgrading Angular using Yeoman

I just installed Angular as follow:
npm install -g generator-angular # install generator
yo angular # scaffold out a AngularJS project
bower install angular-ui # install a dependency for your project from Bower
grunt test # test your app
grunt server # preview your app
grunt # build the application for deployment
That installed 1.0.7 instead of 1.0.8.
I am totally new to Yeoman. How can I upgrade 1.0.7 to 1.0.8? Is this supposed to be done manually?
Please clarify.
You can use Bower that comes with Yeoman to update the dependencies. In Bower, dependencies are listed in a ‘bower.json’ file, similar to Node’s package.json or the Ruby Gemfile.
{
"name": "myProject",
"version": "1.0.0",
"dependencies": {
"angular": "~1.0.8"
}
}
First list the installed packages:
bower list
And to update a package you use the following command:
bower update angular
If you do a bower install angular-ui you will get version 0.40 ... this is not compatible with Bootstrap 3 (if that's what you want. If you want the latest angular-ui you'll have to manually install it.

Bower list matching my dependencies versions

Is there a way for bower list command to show updates available while respecting my dependencies versions
example bower.json :
{
"dependencies": {
"jquery": "<2"
}
}
bower install :
bower installing jquery#1.10.0
jquery update to 1.10.1 (bower info jquery):
jquery
Versions:
- 2.0.2
- 2.0.1
- 2.0.0
- 1.10.1
- 1.10.0
bower list:
bower discover Please wait while newer package versions are being discovered
...
└── jquery#1.10.0 (2.0.2 now available)
Edit:
a correction has been made in master branch.
The bug doesn't exists anymore https://github.com/bower/bower/issues/562
You should open a ticket about it.

Resources