bower.json中的ember-data问题

时间:2015-05-26 07:26:52

标签: ember.js npm ember-data bower bower-install

我有一个ember-cli应用程序,它在bower.json和package.json中都有ember-data。我正面临着这个问题

The package `ember-data` is not a properly formatted package, we have used a fallback lookup to resolve it at `LOCATION`. This is generally caused by an addon not having a `main` entry point (or `index.js`).

我发现将ember-data更新为beta16或更高版本。所以我想到了使用

进行更新
npm install ember-data --save-dev.

这会将package.json更新为"ember-data": "^1.0.0-beta.18",现在为了更新bower,我也做了 凉亭安装ember-data --save。现在它给了我选择两次的选项
1 GT;为此,我选择了!3

Unable to find a suitable version for ember-data, please choose one:
    1) ember-data#~0.0.14 which resolved to 0.0.14
    2) ember-data#1.0.0-beta.14.1 which resolved to 1.0.0-beta.14.1 and is required by text-admin
    3) ember-data#~1.0.0-beta.7 which resolved to 1.0.0-beta.18 and is required by ember-qunit#0.1.8Prefix the choice with ! to persist it to bower.json


2 - ;为此,我选择了!3因为我使用的是ember1.12.0。

Unable to find a suitable version for ember, please choose one:
    1) ember#~1.0.0 which resolved to 1.0.1 and is required by ember-data#0.0.14
    2) ember#>= 1.8.1 < 2.0.0 which resolved to 1.12.0 and is required by ember-data#1.0.0-beta.14.1, ember-data#1.0.0-beta.18
    3) ember#~1.12.0 which resolved to 1.12.0 and is required by text-admin
    4) ember#>=1.4 <2 which resolved to 1.12.0 and is required by ember-cli-shims#0.0.3
    5) ember#> 1.5.0-beta.3 which resolved to 1.12.0 and is required by ember-resolver#0.1.14
    6) ember#^1.3.0 which resolved to 1.12.0 and is required by ember-qunit#0.1.8Prefix the choice with ! to persist it to bower.json

然而,这只会导致余烬数据的变化 "ember-data": "~1.0.0-beta.7"根据决议和&#34; ember-data&#34;:&#34; ~0.0.14&#34;在依赖中。

我的问题:

  1. 如何让bower.json将ember-data更新为"ember-data": "^1.0.0-beta.18"
  2. 为什么bower.json和package.json都存在ember-data?

2 个答案:

答案 0 :(得分:1)

您需要在bower.json和package.json中更新它。这样做的目的是在使用ember-cli创建新项目时不必调用ember g ember-data。因此,为了更新两个文件"ember-data": "^1.0.0-beta.18"中的写入。

答案 1 :(得分:0)

我知道这有点旧,但我仍然认为它会对某人有所帮助。此外,ember-data现在已升级到1.13.14。

@wallop:我想你已经得到了第二个问题的答案。对于第一个问题,要安装特定版本的bower组件,可以尝试以下命令。它可能仍然会要求选项,但我已经体验到它可以按照您的需要工作。

bower install --save ember-data#1.0.0-beta.18