How do I update each dependency in bower.json to the latest version?
For example here are dependencies from bower.json
"dependencies": {
"bootstrap": "~3.1.1",
"socket.io-client": "1.2.1",
"underscore": "~1.6.0",
"angular-bootstrap": "~0.12.0"
}
I can see underscore has a newer 1.7.0 version and bootstrap has a newer version of 3.3.1. If it was npm then I would change versions to *
"dependencies": {
"bootstrap": "*",
"socket.io-client": "*",
"underscore": "*",
"angular-bootstrap": "*"
}
and run npm update --save npm would then download all the latest versions and replace * in the package.json file. However this doesn't work with bower. How do I get bower to do the same thing and update all the packages at once to the newest version?
You are using Tilde Ranges which allows patch-level changes if a minor version is specified on the comparator. Allows minor-level changes if not. For example:
~3.1.1 := >=3.1.1 <3.(1+1).0 := >=3.1.1 <3.2.0
In your case it means that for the dependencies you defined with the tilde range and specify major.minor.patch version (such as ~3.1.1) you will get the latest patch version.
You can use "latest"
as the version target and get the latest version, for example: "bootstrap": "latest"
.
I would suggest use the following keywords
"dependencies": {
"bootstrap": "latest",
"socket.io-client": "latest",
"underscore": "latest",
"angular-bootstrap": "latest"
}
This shall work when you run bower update command.
I would suggest use the following keywords
"dependencies": {
"bootstrap": "latest",
"socket.io-client": "latest",
"underscore": "latest",
"angular-bootstrap": "latest"
}
This shall work when you run bower update command.
Thanks, Ankit Tanna
链接地址: http://www.djcxy.com/p/27680.html