5

I'm attempting to play around with durandal but am getting this error:

enter image description here

error:

bower requirejs extra-resolution Unnecessary resolution: requirejs#~2.2.0

bower.json

{
  "name": "asp.net",
  "private": true,
  "dependencies": {
    "underscore": "~1.8.3",
    "bootstrap": "~3.3.6",
    "bootswatch": "3.3.6",
    "jquery": "2.2.3",
    "jquery-validation": "1.15.0",
    "jquery-validation-unobtrusive": "~3.2.6",
    "angular": "1.5.7",
    "angular-route": "~1.5.7",
    "durandal": "~2.1.0",
    "requirejs": "~2.2.0"
  }
}

Not having luck finding out what it means or what I need to do to fix it. RequireJS has made it into my lib folder, so I'm wondering if it's just not truly an error?

Kritner
  • 13,557
  • 10
  • 46
  • 72

1 Answers1

1

Durandal already depends on requirejs, see here

    {
    "name": "Durandal",
    "version": "2.2.0",
    "dependencies": {
      "jquery": "^1.9.1",
      "knockout": "^3.4.0",
      "requirejs": "^2.1.11",
      "requirejs-text": "^2.0.12"
    }
}

So either remove "requirejs": "~2.2.0" from your bower.json or you can add resolutions to your bower.json file and specify the component name & version, see here.

Community
  • 1
  • 1
Ross
  • 2,123
  • 1
  • 18
  • 18
  • hmmm that's interesting. I don't get the issue anymore or have the project available that was displaying the problem so I can't really confirm. I guess I didn't really realize what the message was trying to convey, but what you're saying makes sense. Why would the compiler only complain about require, when I had other dependencies like jquery included in my bower file as well? – Kritner Dec 16 '16 at 10:09
  • Your other components didn't have version requirements mismatch, e.g. the all needed jquery 2.2.3 – Ross Dec 16 '16 at 13:35
  • But from what you had posted, (and I could very well be misreading this, bower is very new to me) - Durandal requires jquery greater than 1.9.1, and require greater than 2.1.11. In my bower.json above, I'm using a jquery 2.2.3, and require ~2.2.0. I'm assuming the ~2.2.0 means "something around that version. So shouldn't they both be in effect greater than the versions that durandal requires? – Kritner Dec 16 '16 at 13:40
  • "requirejs": "^2.1.11" tells bower that it can accept any version that is 2.1.11 or higher in PATCHES only (third position in version #), e.g. 2.1.12, 2.1.13 and so on. version 2.2.xxx is not acceptable as it is a minor update not a patch update. You are asking for requirejs v2.2.0 or higher in MINOR version, e.g. 2.3.x and that conflicts with 2.1.11+x requirement of Durandal. Here is nice explanation of versioning in bower http://stackoverflow.com/questions/19030170/what-is-the-bower-and-npm-version-syntax – Ross Dec 16 '16 at 15:52
  • For jQuery, check your bower.json Does it already contain resolutions section? E.g. "resolutions": {"jquery": ">=1.8"} – Ross Dec 16 '16 at 16:02