0
votes

i have an ember-cli app which has ember-data in both bower.json and package.json. I was facing the issue

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`).

I found out that updating ember-data to beta16 or above. So i thought of updating using

npm install ember-data --save-dev.

This would update package.json to "ember-data": "^1.0.0-beta.18", now in order to update bower as well i did bower install ember-data --save. Now it gave me options to choose twice which are
1> For this i chose !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> For this i chose !3 since i was using 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

However this only ended up in ember-data becoming "ember-data": "~1.0.0-beta.7" under resolutions and "ember-data": "~0.0.14" in dependencies.

My Questions:

  1. How to get bower.json to update ember-data to "ember-data": "^1.0.0-beta.18"?
  2. Why is ember-data present in both bower.json and package.json?
2

2 Answers

2
votes

You need to update it in both bower.json and package.json. The purpose of this is you don't have to invoke ember g ember-data when creating a new project with ember-cli. So in order to update write in both files "ember-data": "^1.0.0-beta.18".

0
votes

I know this is a bit old but I still think it will help someone. Also ember-data is now upgraded to 1.13.14 as of today.

@wallop: I think you've already got the answer for your second question. For the first question, to install a specific version of a bower component, you can try the following command. It might still ask for the option but I have experienced that it works as you wanted.

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