ali haghighatkhah February 2016

how to force bower to install a certain version of dependency

Assume a bower.json file in which dependencies are like

"dependencies": {
    "angular": "~1.5.x",
    "angular-routing": "*",
    "ngDialog": "*",
    "requirejs": "*"
}

because angular-routing requires another version of angular (say 1.2.x), bower prompts me to choose a version.

How could I force bower to install angular ~1.5.x automatically?

Answers


ali haghighatkhah February 2016

I figured out the answer. I'm sharing for others:

If I add the dependency with my favorite version to resolutions in bower.json, Bower will automatically install it. Here is my updated bower.json:

"dependencies": {
  "angular": "~1.5.x",
  "angular-routing": "*",
  "ngDialog": "*",
  "requirejs": "*"
},
"resolutions": {
  "angular": "~1.5.x"
}

More information here.

Post Status

Asked in February 2016
Viewed 1,659 times
Voted 12
Answered 1 times

Search




Leave an answer