Dependencies issue on dotCloud

Problem

I have an issue while deploying my nodejs app on dotCloud regarding the dependencies. This app use node-canvas (https://github.com/LearnBoost/node-canvas) to generate a thumbnail of the sheet music (related to the music sheets available on jellynote.com).

I don't have any error during the push of my application and the installation of the dependencies. Here is my package.json file:

{
  "name": "jellyscore",
  "version": "1.0.0",
  "dependencies": {
    "canvas": "",
    "mongodb": ""
  }
}

and here is the logs that dotCloud return (edited log):

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: Cannot find module '../build/default/canvas'
    at Function._resolveFilename (module.js:326:11)
    at Function._load (module.js:271:25)
    at require (module.js:355:19)
    at Object.<anonymous> (/home/dotcloud/node_modules/canvas/lib/bindings.js:7:20)
    at Module._compile (module.js:411:26)
    at Object..js (module.js:417:10)
    at Module.load (module.js:343:31)
    at Function._load (module.js:302:12)
    at require (module.js:355:19)
    at Object.<anonymous> (/home/dotcloud/node_modules/canvas/lib/canvas.js:12:14)

Thanks!

Problem courtesy of: arthur

Solution

Have you added CAIRO as system dependency ?

in you dotCloud yml:

systempackages:
    - libcairo2

So if you have a Node.js only app it should look like this:

www:
    type: nodejs
    systempackages:
       - libcairo2
Solution courtesy of: 3on

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.