Ramon Tayag
Ramon Tayag

Reputation: 16084

Why does bower not seem to install the missing dependencies with `bower install`?

I'm trying to install ember-cli-foundation-sass in a new ember-cli app. I get this error:

$ ember server --proxy http://localhost:3000

Missing bower packages:
Package: jquery
  * Specified: ^1.11.1
  * Installed: 2.1.4

Run `bower install` to install missing dependencies.

I run bower install like it recommends, but when I start the server, I see the same error message.

What can I do to install jQuery 1.11.1?

Upvotes: 1

Views: 3575

Answers (3)

esbanarango
esbanarango

Reputation: 1637

Use resolutions in your bower.json

{
  "name": "refactor",
  "private": true,
  "dependencies": {
    "jquery": "~1.11.1",
    "ember-cli-foundation-sass": "1.0.0",
    "font-awesome": "~4.3.0",
    "foundation": "x"
  },
  "resolutions": {
    "jquery": "~1.11.1"
  }
}

This will force bower to use that specific version of jQuery.

Upvotes: 1

Ramon Tayag
Ramon Tayag

Reputation: 16084

I think the issue is that the specified jquery version I had (^1.11.1) wasn't compatible with all other libraries. When I typed bower install jquery like @Spetron suggested, I saw:

Unable to find a suitable version for jquery, please choose one:
1) jquery#^1.11.1 which resolved to 1.11.3 and is required by spp-ui
2) jquery#>= 1.7.0 < 2.2.0 which resolved to 2.1.4 and is required by ember#1.12.0
3) jquery#>=1.2 which resolved to 2.1.4 and is required by jquery.cookie#1.4.1
4) jquery#>= 2.1.0 which resolved to 2.1.4 and is required by foundation#5.5.2
5) jquery#>=1.6 which resolved to 2.1.4 and is required by jquery-placeholder#2.0.9
6) jquery#~2.1.4 which resolved to 2.1.4

I suppose the issue is that bower install doesn't warn you or throw an error if it can't find a suitable version of a library. It's just quiet about it, making it seem like it installed what it needed.

Upvotes: 0

iamuros
iamuros

Reputation: 31

You can use bower to install JQuery!

bower install jquery

...or if you need to install a certain version, use

bower install http://code.jquery.com/jquery-<version>.min.js

Upvotes: 3

Related Questions