2015-06-20 153 views
1

我正試圖在一個新的ember-cli應用程序中安裝ember-cli-foundation-sass。我得到這個錯誤:爲什麼bower似乎沒有用`bower install`安裝缺失的依賴關係?

$ 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. 

我跑bower install喜歡它建議,但是當我啓動服務器,我看到相同的錯誤消息。

我能做些什麼來安裝jQuery 1.11.1

回答

3

您可以使用bower安裝JQuery!

bower install jquery 

...或者,如果你需要安裝某個版本,使用

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

我認爲這個問題是指定的jQuery的版本我有(^1.11.1)不是與所有其他兼容庫。當我輸入bower install jquery像@Spetron建議,我看到:

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 

我想這個問題是bower install沒有提醒你或者拋出一個錯誤,如果它不能找到一個圖書館的一個合適的版本。它只是安靜的,使它看起來像安裝了它所需要的。

1

在使用resolutionsbower.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" 
    } 
} 

這將迫使涼亭使用jQuery的特定版本。