LearnBoost/node-canvas — Issue #137: Error installing canvas with npm
Author: e98cuenc
Created: 2011-12-23 16:44:30+00:00
State: open

I tried to install canvas in a Mac Snow Leopard with latest node (0.6.6):

cuenca-macbookair:~ cuenca$ npm install canvas
npm info it worked if it ends with ok
npm info using npm@1.1.0-beta-4
npm info using node@v0.6.6
npm http GET https://registry.npmjs.org/canvas
npm http 304 https://registry.npmjs.org/canvas
npm info into /Users/cuenca canvas@0.8.2
npm info installOne canvas@0.8.2
npm info unbuild /Users/cuenca/node_modules/canvas
npm info preinstall canvas@0.8.2

> canvas@0.8.2 preinstall /Users/cuenca/node_modules/canvas
> 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 : ok /usr/local
Checking for library gif : not found
Checking for library jpeg : yes
Checking for cairo : yes
'configure' finished successfully (0.706s)
Waf: Entering directory `/Users/cuenca/node_modules/canvas/build'
[1/9] cxx: src/Canvas.cc -> build/Release/src/Canvas_1.o
[2/9] cxx: src/CanvasGradient.cc -> build/Release/src/CanvasGradient_1.o
[3/9] cxx: src/CanvasRenderingContext2d.cc -> build/Release/src/CanvasRenderingContext2d_1.o
[4/9] cxx: src/color.cc -> build/Release/src/color_1.o
[5/9] cxx: src/Image.cc -> build/Release/src/Image_1.o
[6/9] cxx: src/ImageData.cc -> build/Release/src/ImageData_1.o
[7/9] cxx: src/init.cc -> build/Release/src/init_1.o
[8/9] cxx: src/PixelArray.cc -> build/Release/src/PixelArray_1.o
[9/9] cxx_link: build/Release/src/Canvas_1.o build/Release/src/CanvasGradient_1.o build/Release/src/CanvasRenderingContext2d_1.o build/Release/src/color_1.o build/Release/src/Image_1.o build/Release/src/ImageData_1.o build/Release/src/init_1.o build/Release/src/PixelArray_1.o -> build/Release/canvas.node
ld: warning: directory '/lib' following -L not found
Waf: Leaving directory `/Users/cuenca/node_modules/canvas/build'
'build' finished successfully (4.705s)
npm info build /Users/cuenca/node_modules/canvas
npm info linkStuff canvas@0.8.2
npm info install canvas@0.8.2
npm info postinstall canvas@0.8.2
canvas@0.8.2 ./node_modules/canvas
npm info ok
cuenca-macbookair:~ cuenca$ node
> require('canvas')
Error: Cannot find module '../build/default/canvas'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object. (/Users/cuenca/node_modules/canvas/lib/bindings.js:7:20)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
>

Any ideas on what went wrong?

Thanks!