Package.json vs bower.json and Ember version


#1

I’m having issues deploying my app to production, I think that different versions of Ember are used un my development and my production environments… I was trying to figure out the cause and I arrive to some conflictive configurations into my package.json and my bower.json files:

Check that there are discrepancies between the ember version in both files… also the amount of references to the package is 4… looks too many… I don’t know.

When I run ember version this is what I get:

└─▪ ember -v
version: 1.13.12
node: 5.0.0
npm: 2.14.10
os: darwin x64

But I suppose this is the version for the ember cli.

In the Browser’s console I can see:

DEBUG: -------------------------------
Ember      : 2.2.0
Ember Data : 2.2.0
jQuery     : 2.1.4
DEBUG: -------------------------------

But in the production Browser’s console I don’t see this message.

My questions are

  1. why are there so many references to the ember package, why they are in both files?
  2. why are there different versions and which version is used in development and which in production?

Thanks

f.


#2

AFAIK bower.json is for bower dependencies and package. json is for npm dependencies. That being said your question is so complicated that I don’t get it


#3

package.json should not have any versions of Ember at this time. Also, 1.0.0-pre.2 is a very old version.


#4

remove lines 24 and 46 from package.json (from your screenshot)… you don’t need ember referenced in the package.json file. Then you should be fine.

The line 28 in your bower.json could be removed, but it doesn’t matter if it stays.

To answer your questions.

  1. There only needs to be one reference to ember and it should be in bower.json dependencies hash.
  2. You shouldn’t be referencing different versions ember - you can only use one version of ember at a time. and it will be the one in the bower.json file

The resolutions hash in the bower.json file allows you to specify which version of a package to use when two different versions of the same package are specified (by other packages in your dependencies hash). Google “bower.json resolutions” for more info.


#5

Cool @LozJackson… thanks