LearnBoost/node-canvas — Issue #121: No such file or directory for Node files on npm install
Author: justinkendler
Created: 2011-10-13 15:05:53+00:00
State: open

I've installed the dependencies as far as I know and set NODE_PATH, but certain files called from Canvas.h are not found. My apologies if this is a duplicate issue.

Console Log below:

npm install canvas

> canvas@0.7.3 preinstall /usr/local/lib/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 : ok /usr/local/bin/node
Checking for node prefix : ok /usr/local
Checking for library gif : yes
Checking for library jpeg : yes
Checking for cairo : yes
'configure' finished successfully (0.213s)
Waf: Entering directory `/usr/local/lib/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
In file included from ../src/Canvas.cc:8:
../src/Canvas.h:11:16: error: v8.h: No such file or directory
../src/Canvas.h:12:18: error: node.h: No such file or directory
../src/Canvas.h:13:30: error: node_object_wrap.h: No such file or directory
In file included from ../src/CanvasGradient.cc:9:
../src/Canvas.h:11:16: error: v8.h: No such file or directory
../src/Canvas.h:12:18: error: node.h: No such file or directory
../src/Canvas.h:13:30: error: node_object_wrap.h: No such file or directory
../src/Canvas.cc:13:25: error: node_buffer.h: No such file or directory
../src/Canvas.cc:14:26: error: node_version.h: No such file or directory
In file included from ../src/Canvas.cc:8:
../src/Canvas.h:16: error: ‘v8’ is not a namespace-name
../src/Canvas.h:16: error: expected namespace-name before ‘;’ token
../src/Canvas.h:17: error: ‘node’ is not a namespace-name
../src/Canvas.h:17: error: expected namespace-name before ‘;’ token
../src/Canvas.h:32: error: ‘node’ has not been declared
../src/Canvas.h:32: error: expected `{' before ‘ObjectWrap’
../src/Canvas.h:32: error: function definition does not declare parameters
In file included from ../src/CanvasRenderingContext2d.h:13,
from ../src/Canvas.cc:9:
../src/CanvasGradient.h:13: error: ‘node’ has not been declared
../src/CanvasGradient.h:13: error: expected `{' before ‘ObjectWrap’
../src/CanvasGradient.h:13: error: function definition does not declare parameters
In file included from ../src/Canvas.cc:9:
../src/CanvasRenderingContext2d.h:37: error: ‘node’ has not been declared
../src/CanvasRenderingContext2d.h:37: error: expected `{' before ‘ObjectWrap’
../src/CanvasRenderingContext2d.h:37: error: function definition does not declare parameters
In file included from ../src/Canvas.cc:15:
../src/closure.h:16: error: ISO C++ forbids declaration of ‘Persistent’ with no type
../src/closure.h:16: error: expected ‘;’ before ‘<’ token
../src/closure.h:17: error: ISO C++ forbids declaration of ‘Handle’ with no type
../src/closure.h:17: error: expected ‘;’ before ‘<’ token
../src/closure.h: In function ‘void closure_destroy(closure_t*)’:
../src/closure.h:47: error: ‘V8’ has not been declared
../src/Canvas.cc: At global scope:
../src/Canvas.cc:17: error: expected constructor, destructor, or type conversion before ‘<’ token
../src/Canvas.cc:24: error: invalid use of incomplete type ‘class Canvas’
../src/Canvas.h:32: error: forward declaration of ‘class Canvas’
../src/Canvas.cc:24: error: ‘Handle’ was not declared in this scope
../src/Canvas.cc:24: error: ‘Object’ was not declared in this scope
../src/Canvas.cc:24: error: ‘target’ was not declared in this scope
../src/Canvas.cc:45: error: expected constructor, destructor, or type conversion before ‘<’ token
../src/Canvas.cc:60: error: expected constructor, destructor, or type conversion before ‘<’ token
../src/Canvas.cc:72: error: invalid use of incomplete type ‘class Canvas’
../src/Canvas.h:32: error: forward declaration of ‘class Canvas’
../src/Canvas.cc:72: error: ‘Local’ was not declared in this scope
../src/Canvas.cc:72: error: ‘String’ was not declared in this scope
../src/Canvas.cc:72: error: ‘prop’ was not declared in this scope
../src/Canvas.cc:72: error: ‘Local’ was not declared in this scope
../src/Canvas.cc:72: error: ‘Value’ was not declared in this scope
../src/Canvas.cc:72: error: ‘val’ was not declared in this scope
../src/Canvas.cc:72: error: expected primary-expression before ‘const’
In file included from ../src/CanvasGradient.cc:9:
../src/Canvas.h:16: error: ‘v8’ is not a namespace-name
../src/Canvas.h:16: error: expected namespace-name before ‘;’ token
../src/Canvas.h:17: error: ‘node’ is not a namespace-name
../src/Canvas.h:17: error: expected namespace-name before ‘;’ token
../src/Canvas.h:32: error: ‘node’ has not been declared
../src/Canvas.h:32: error: expected `{' before ‘ObjectWrap’
../src/Canvas.h:32: error: function definition does not declare parameters
In file included from ../src/CanvasGradient.cc:10:
../src/CanvasGradient.h:13: error: ‘node’ has not been declared
../src/CanvasGradient.h:13: error: expected `{' before ‘ObjectWrap’
../src/CanvasGradient.h:13: error: function definition does not declare parameters
../src/CanvasGradient.cc:12: error: expected constructor, destructor, or type conversion before ‘<’ token
../src/CanvasGradient.cc:19: error: invalid use of incomplete type ‘class Gradient’
../src/CanvasGradient.h:13: error: forward declaration of ‘class Gradient’
../src/CanvasGradient.cc:19: error: ‘Handle’ was not declared in this scope
../src/CanvasGradient.cc:19: error: ‘Object’ was not declared in this scope
../src/CanvasGradient.cc:19: error: ‘target’ was not declared in this scope
../src/CanvasGradient.cc:36: error: expected constructor, destructor, or type conversion before ‘<’ token
Waf: Leaving directory `/usr/local/lib/node_modules/canvas/build'
Build failed:
-> task failed (err #1):
{task: cxx Canvas.cc -> Canvas_1.o}
-> task failed (err #1):
{task: cxx CanvasGradient.cc -> CanvasGradient_1.o}
npm ERR! error installing canvas@0.7.3 Error: canvas@0.7.3 preinstall: `node-waf configure build`
npm ERR! error installing canvas@0.7.3 `sh "-c" "node-waf configure build"` failed with 1
npm ERR! error installing canvas@0.7.3 at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing canvas@0.7.3 at ChildProcess.emit (events.js:67:17)
npm ERR! error installing canvas@0.7.3 at ChildProcess.onexit (child_process.js:246:12)
npm ERR! canvas@0.7.3 preinstall: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
npm ERR!
npm ERR! Failed at the canvas@0.7.3 preinstall script.
npm ERR! This is most likely a problem with the canvas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls canvas
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Darwin 10.8.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "canvas"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/local/lib/npm-debug.log
npm not ok