krakenjs / makara

An internationalization module for kraken and express
Other
135 stars 42 forks source link

Unable to use latest dustjs version due to package.json conflict in makara #24

Closed mindpivot closed 10 years ago

mindpivot commented 10 years ago

When deploying a build to heroku, the compile/deploy step fails due to a version conflict between my package.json containing the latest (2.3.x) of dustjs-linkedin and the specified 2.0.0 version in Makara. There is a similar problem with the declared version of dustjs-linkedin in the Adaro package.json.

I'd suggest setting them to use 2.x.x instead of explicit versions and only make it more restrictive if it's found LinkedIn changed the dust signature/API.

mindpivot commented 10 years ago

Ok so here's what's going on. In my package.json I have the following:

{
  "name": "...",
  "description": "...",
  "author": "mindpivot",
  "version": "0.0.4",
  "private": true,
  "scripts": {
    "test": "grunt test",
    "start": "bin/web",
    "postinstall": "grunt build"
  },
  "dependencies": {
    "kraken-js": "~0.7.0",
    "express": "~3.4.8",
    "adaro": "~0.1.x",
    "nconf": "~0.6.9",
    "less": "~1.6.1",
    "makara": "~0.3.3",
    "mongoose": "~3.8.5",
    "newrelic": "~1.3.0",
    "connect-mongo": "~0.4.0",
    "connect-flash": "~0.1.1",
    "view-helpers": "~0.1.4",
    "async": "~0.2.10",
    "dustjs-helpers": "~1.1.2",
    "bcrypt": "~0.7.7",
    "passport": "~0.2.0",
    "passport-local": "~0.1.6",
    "dustjs-linkedin": "~2.3.2", // Note version here
   ...
}

When I build and run locally using foreman, no issues. However, when I then commit everything in git then push using the heroku command:

$ git push heroku master

This is the first error in the console output (see attached text for entire log):

       npm ERR! peerinvalid The package dustjs-linkedin does not satisfy its siblings' peerDependencies requirements!
       npm ERR! peerinvalid Peer makara@0.3.3 wants dustjs-linkedin@~2.0.0

       npm ERR! System Linux 3.8.11-ec2
       npm ERR! command "/tmp/build_4a748da6-10f7-4221-9c2c-429a7eaf77ac/vendor/node/bin/node" "/tmp/build_4a748da6-10f7-4221-9c2c-429a7eaf77ac/vendor/node/bin/npm" "install" "--userconfig" "/tmp/build_4a748da6-10f7-4221-9c2c-429a7eaf77ac/.npmrc" "--production"
       npm ERR! cwd /tmp/build_4a748da6-10f7-4221-9c2c-429a7eaf77ac
       npm ERR! node -v v0.10.25
       npm ERR! npm -v 1.3.24
       npm ERR! code EPEERINVALID
       npm ERR! 
       npm ERR! Additional logging details can be found in:
       npm ERR!     /tmp/build_4a748da6-10f7-4221-9c2c-429a7eaf77ac/npm-debug.log
       npm ERR! not ok code 0
0 info it worked if it ends with ok

The error seems to be due to the "peerDependencies" configuration in Makara's package.json. It explicitly declares the 2.0.0 release of dustjs-linkedin without any room for wiggle. Heroku's build process is seeing that and failing. When I remove Makara and use the latest release of dustjs-linkedin the Heroku build works fine.

heroku-error.txt | uploaded via ZenHub

mikemliu commented 10 years ago

I'm using kraken with makara, and seeing the same. Compilation with grunt-dustjs uses dustjs-linkedin-2.3.x which conflicts with runtime dustjs of 2.0 (required by makara).

My templates are failing with dust error:

TypeError: Object [object Object] has no method '_get'
    at body_3 (cache.vm:1:716)

Please update dust dependency to 2.3.x!!!

jeffharrell commented 10 years ago

Is there any reason that the peerDependency can't be changed to use a ^ instead of a ~ and pick up the newer minor versions?

mindpivot commented 10 years ago

I wouldn't think so. I investigated this back when I submitted it and in going through some of the code and changelogs I didn't see anything breaking b/w 2.0 and 2.3.

mindpivot commented 10 years ago

Sorry.... that "close" was a mis-click when trying to update my last comment. Apologies.

jeffharrell commented 10 years ago

0.3.4 was just published to solve this per #34.