LearnBoost/node-canvas — Issue #130: installs ok - crashes on bindings.js load
Author: elspoono
Created: 2011-11-27 17:33:34+00:00
State: open

I think it installs okay. This is the result of my node-waf configure build.

```
> node-waf configure build

Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : not found
Checking for library gif : not found
Checking for library jpeg : yes
Checking for cairo : yes
'configure' finished successfully (0.360s)
Waf: Entering directory `/Users/derek/Desktop/cards.ly/node_modules/canvas/build'
[1/9] cxx: src/Canvas.cc -> build/default/src/Canvas_1.o
[2/9] cxx: src/CanvasGradient.cc -> build/default/src/CanvasGradient_1.o
[3/9] cxx: src/CanvasRenderingContext2d.cc -> build/default/src/CanvasRenderingContext2d_1.o
[4/9] cxx: src/color.cc -> build/default/src/color_1.o
[5/9] cxx: src/Image.cc -> build/default/src/Image_1.o
[6/9] cxx: src/ImageData.cc -> build/default/src/ImageData_1.o
[7/9] cxx: src/init.cc -> build/default/src/init_1.o
[8/9] cxx: src/PixelArray.cc -> build/default/src/PixelArray_1.o
[9/9] cxx_link: build/default/src/Canvas_1.o build/default/src/CanvasGradient_1.o build/default/src/CanvasRenderingContext2d_1.o build/default/src/color_1.o build/default/src/Image_1.o build/default/src/ImageData_1.o build/default/src/init_1.o build/default/src/PixelArray_1.o -> build/default/canvas.node
ld: warning: directory not found for option '-L/lib'
Waf: Leaving directory `/Users/derek/Desktop/cards.ly/node_modules/canvas/build'
'build' finished successfully (1.412s)
```

Then when attempting to require 'canvas', I get a crash, but I'm unsure of where to find more details on the crash.

```
27 Nov 10:23:49 - ÆnodemonÅ starting node
The "sys" module is now called "util". It should have a similar interface.

27 Nov 10:23:50 - ÆnodemonÅ app crashed - waiting for file change before starting...
```

By deleting sections of code, I narrowed it down to bindings.js, it's loading the canvas.node in default there. Line 7 in bindings.js, that seems to be causing the crash.

```javascript
/**
* Compat for changes from node 0.4.x to 0.6.x.
*/
try {
module.exports = require('../build/Release/canvas');
} catch (e) { try {
module.exports = require('../build/default/canvas');
} catch (e) {
throw e;
}}

```

This is on OSX. Node 0.6.3, and following the instructions at https://github.com/LearnBoost/node-canvas/wiki/Installation---OSX

Point me in the right direction, I'll try to debug further :)

Thanks!
Derek