Maybe it's due to version of canvas module (1.0.3) specified as dependency in ansi-canvas' package.json , because if I install standalone canvas module (current is 1.1.6) I haven't any problems.
[email protected] install /home/q2dg/node_modules/ansi-canvas/node_modules/canvas
node-gyp rebuild
child_process: customFds option is deprecated, use stdio instead.
make: Entering directory `/home/q2dg/node_modules/ansi-canvas/node_modules/canvas/build'
CXX(target) Release/obj.target/canvas/src/Canvas.o
In file included from ../src/Canvas.h:22:0,
from ../src/Canvas.cc:7:
../src/nan.h: In function ‘void NanThrowError(const char*)’:
../src/nan.h:105:46: error: ‘ThrowException’ is not a member of ‘v8’
THROW_ERROR(v8::Exception::Error, errmsg);
^
../src/nan.h:105:86: error: ‘New’ is not a member of ‘v8::String’
THROW_ERROR(v8::Exception::Error, errmsg);
^
../src/nan.h: In function ‘void NanThrowError(v8::Local<v8::Value>)’:
../src/nan.h:110:5: error: ‘ThrowException’ is not a member of ‘v8’
v8::ThrowException(error);
^
../src/nan.h: In function ‘void NanThrowTypeError(const char*)’:
../src/nan.h:114:46: error: ‘ThrowException’ is not a member of ‘v8’
THROW_ERROR(v8::Exception::TypeError, errmsg);
^
../src/nan.h:114:90: error: ‘New’ is not a member of ‘v8::String’
THROW_ERROR(v8::Exception::TypeError, errmsg);
^
In file included from ../src/Canvas.h:22:0,
from ../src/Canvas.cc:7:
../src/nan.h: In function ‘void NanThrowRangeError(const char*)’:
../src/nan.h:118:46: error: ‘ThrowException’ is not a member of ‘v8’
THROW_ERROR(v8::Exception::RangeError, errmsg);
^
../src/nan.h:118:91: error: ‘New’ is not a member of ‘v8::String’
THROW_ERROR(v8::Exception::RangeError, errmsg);
^
../src/nan.h: In function ‘void NanDispose(v8::Persistent<v8::Object>&)’:
../src/nan.h:122:12: error: ‘class v8::Persistent<v8::Object>’ has no member named ‘Dispose’
handle.Dispose(nan_isolate);
^
In file included from ../src/Canvas.h:22:0,
from ../src/Canvas.cc:7:
../src/nan.h: In constructor ‘NanCallback::NanCallback(const v8::Local<v8::Function>&)’:
../src/nan.h:229:48: error: no matching function for call to ‘v8::Object::New()’
v8::Local<v8::Object> obj = v8::Object::New();
^
../src/nan.h:229:48: note: candidate is:
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:2372:24: note: static v8::Local<v8::Object> v8::Object::New(v8::Isolate*)
static Local<Object> New(Isolate* isolate);
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:2372:24: note: candidate expects 1 argument, 0 provided
In file included from ../src/Canvas.h:22:0,
from ../src/Canvas.cc:7:
../src/nan.h:230:13: error: ‘NewSymbol’ is not a member of ‘v8::String’
obj->Set(NanSymbol("callback"), fn);
^
../src/nan.h: In destructor ‘NanCallback::~NanCallback()’:
../src/nan.h:236:11: error: ‘class v8::Persistent<v8::Object>’ has no member named ‘Dispose’
handle.Dispose();
^
../src/nan.h: In member function ‘void NanCallback::Call(int, v8::Local<v8::Value>*)’:
../src/nan.h:252:12: error: ‘NewSymbol’ is not a member of ‘v8::String’
Get(NanSymbol("callback")).As<v8::Function>();
^
../src/nan.h:252:62: error: expected primary-expression before ‘>’ token
Get(NanSymbol("callback")).As<v8::Function>();
^
../src/nan.h:252:64: error: expected primary-expression before ‘)’ token
Get(NanSymbol("callback")).As<v8::Function>();
^
../src/nan.h:254:19: error: ‘GetCurrent’ is not a member of ‘v8::Context’
callback->Call(v8::Context::GetCurrent()->Global(), argc, argv);
^
../src/nan.h: At global scope:
../src/nan.h:291:3: error: ‘uv_work_t’ does not name a type
uv_work_t request;
^
../src/nan.h: In constructor ‘NanAsyncWorker::NanAsyncWorker(NanCallback*)’:
../src/nan.h:267:5: error: ‘request’ was not declared in this scope
request.data = this;
^
../src/nan.h: In member function ‘void NanAsyncWorker::SavePersistent(const char*, v8::Local<v8::Object>&)’:
../src/nan.h:300:17: error: ‘NewSymbol’ is not a member of ‘v8::String’
handle->Set(NanSymbol(key), obj);
^
../src/nan.h: In member function ‘v8::Local<v8::Object> NanAsyncWorker::GetFromPersistent(const char*)’:
../src/nan.h:305:24: error: ‘NewSymbol’ is not a member of ‘v8::String’
return handle->Get(NanSymbol(key)).As<v8::Object>();
^
../src/nan.h:305:65: error: expected primary-expression before ‘>’ token
return handle->Get(NanSymbol(key)).As<v8::Object>();
^
../src/nan.h:305:67: error: expected primary-expression before ‘)’ token
return handle->Get(NanSymbol(key)).As<v8::Object>();
^
../src/nan.h: In member function ‘virtual void NanAsyncWorker::HandleErrorCallback()’:
../src/nan.h:318:30: error: ‘New’ is not a member of ‘v8::String’
v8::Exception::Error(v8::String::New(errmsg))
^
../src/nan.h: At global scope:
../src/nan.h:324:30: error: variable or field ‘NanAsyncExecute’ declared void
inline void NanAsyncExecute (uv_work_t* req) {
^
../src/nan.h:324:30: error: ‘uv_work_t’ was not declared in this scope
../src/nan.h:324:41: error: ‘req’ was not declared in this scope
inline void NanAsyncExecute (uv_work_t* req) {
^
../src/nan.h:329:38: error: variable or field ‘NanAsyncExecuteComplete’ declared void
inline void NanAsyncExecuteComplete (uv_work_t* req) {
^
../src/nan.h:329:38: error: ‘uv_work_t’ was not declared in this scope
../src/nan.h:329:49: error: ‘req’ was not declared in this scope
inline void NanAsyncExecuteComplete (uv_work_t* req) {
^
../src/nan.h: In function ‘void NanAsyncQueueWorker(NanAsyncWorker*)’:
../src/nan.h:337:23: error: ‘uv_default_loop’ was not declared in this scope
uv_default_loop()
^
../src/nan.h:338:16: error: ‘class NanAsyncWorker’ has no member named ‘request’
, &worker->request
^
../src/nan.h:339:7: error: ‘NanAsyncExecute’ was not declared in this scope
, NanAsyncExecute
^
../src/nan.h:340:8: error: ‘uv_after_work_cb’ was not declared in this scope
, (uv_after_work_cb)NanAsyncExecuteComplete
^
../src/nan.h:341:3: error: ‘uv_queue_work’ was not declared in this scope
);
^
In file included from ../src/Canvas.cc:7:0:
../src/Canvas.h: At global scope:
../src/Canvas.h:67:31: error: ‘uv_work_t’ has not been declared
static void ToBufferAsync(uv_work_t *req);
^
../src/Canvas.h:68:36: error: ‘uv_work_t’ has not been declared
static void ToBufferAsyncAfter(uv_work_t *req);
^
In file included from ../src/Canvas.cc:15:0:
../src/closure.h: In function ‘void closure_destroy(closure_t*)’:
../src/closure.h:49:5: error: ‘AdjustAmountOfExternalAllocatedMemory’ is not a member of ‘v8::V8’
V8::AdjustAmountOfExternalAllocatedMemory(- (intptr_t) closure->max_len);
^
In file included from ../src/Canvas.cc:18:0:
../src/JPEGStream.h: In function ‘boolean empty_closure_output_buffer(j_compress_ptr)’:
../src/JPEGStream.h:36:30: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
Local<Value>::New(Null())
^
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:306:28: note: declared here
friend Handle<Primitive> Null(Isolate* isolate);
^
In file included from ../src/Canvas.cc:18:0:
../src/JPEGStream.h:37:28: error: no matching function for call to ‘v8::Local<v8::Value>::New(v8::Local<v8::Object>&)’
, Local<Value>::New(buf)
^
../src/JPEGStream.h:37:28: note: candidates are:
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:368:57: note: static v8::Local<T> v8::Local<T>::New(v8::Isolate*, v8::Handle<T>) [with T = v8::Value]
V8_INLINE static Local<T> New(Isolate* isolate, Handle<T> that);
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:368:57: note: candidate expects 2 arguments, 1 provided
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:369:57: note: static v8::Local<T> v8::Local<T>::New(v8::Isolate*, const v8::PersistentBase<T>&) [with T = v8::Value]
V8_INLINE static Local<T> New(Isolate* isolate,
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:369:57: note: candidate expects 2 arguments, 1 provided
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:391:57: note: static v8::Local<T> v8::Local<T>::New(v8::Isolate*, T*) [with T = v8::Value]
V8_INLINE static Local<T> New(Isolate* isolate, T* that);
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:391:57: note: candidate expects 2 arguments, 1 provided
In file included from ../src/Canvas.cc:18:0:
../src/JPEGStream.h:38:33: error: no matching function for call to ‘v8::Integer::New(int&)’
, Integer::New(dest->bufsize)
^
../src/JPEGStream.h:38:33: note: candidate is:
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:1989:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
static Local<Integer> New(Isolate* isolate, int32_t value);
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:1989:25: note: candidate expects 2 arguments, 1 provided
In file included from ../src/Canvas.cc:18:0:
../src/JPEGStream.h:40:27: error: ‘GetCurrent’ is not a member of ‘v8::Context’
dest->closure->fn->Call(Context::GetCurrent()->Global(), 3, argv);
^
../src/JPEGStream.h: In function ‘void term_closure_destination(j_compress_ptr)’:
../src/JPEGStream.h:54:30: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
Local<Value>::New(Null())
^
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:306:28: note: declared here
friend Handle<Primitive> Null(Isolate* isolate);
^
In file included from ../src/Canvas.cc:18:0:
../src/JPEGStream.h:55:28: error: no matching function for call to ‘v8::Local<v8::Value>::New(v8::Local<v8::Object>&)’
, Local<Value>::New(buf)
^
../src/JPEGStream.h:55:28: note: candidates are:
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:368:57: note: static v8::Local<T> v8::Local<T>::New(v8::Isolate*, v8::Handle<T>) [with T = v8::Value]
V8_INLINE static Local<T> New(Isolate* isolate, Handle<T> that);
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:368:57: note: candidate expects 2 arguments, 1 provided
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:369:57: note: static v8::Local<T> v8::Local<T>::New(v8::Isolate*, const v8::PersistentBase<T>&) [with T = v8::Value]
V8_INLINE static Local<T> New(Isolate* isolate,
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:369:57: note: candidate expects 2 arguments, 1 provided
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:391:57: note: static v8::Local<T> v8::Local<T>::New(v8::Isolate*, T*) [with T = v8::Value]
V8_INLINE static Local<T> New(Isolate* isolate, T* that);
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:391:57: note: candidate expects 2 arguments, 1 provided
In file included from ../src/Canvas.cc:18:0:
../src/JPEGStream.h:56:29: error: no matching function for call to ‘v8::Integer::New(size_t&)’
, Integer::New(remaining)
^
../src/JPEGStream.h:56:29: note: candidate is:
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:1989:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
static Local<Integer> New(Isolate* isolate, int32_t value);
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:1989:25: note: candidate expects 2 arguments, 1 provided
In file included from ../src/Canvas.cc:18:0:
../src/JPEGStream.h:59:27: error: ‘GetCurrent’ is not a member of ‘v8::Context’
dest->closure->fn->Call(Context::GetCurrent()->Global(), 3, data_argv);
^
../src/JPEGStream.h:63:30: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
Local<Value>::New(Null())
^
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:306:28: note: declared here
friend Handle<Primitive> Null(Isolate* isolate);
^
In file included from ../src/Canvas.cc:18:0:
../src/JPEGStream.h:64:30: error: too few arguments to function ‘v8::Handle<v8::Primitive> v8::Null(v8::Isolate*)’
, Local<Value>::New(Null())
^
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:306:28: note: declared here
friend Handle<Primitive> Null(Isolate* isolate);
^
In file included from ../src/Canvas.cc:18:0:
../src/JPEGStream.h:65:21: error: no matching function for call to ‘v8::Integer::New(int)’
, Integer::New(0)
^
../src/JPEGStream.h:65:21: note: candidate is:
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:1989:25: note: static v8::Local<v8::Integer> v8::Integer::New(v8::Isolate*, int32_t)
static Local<Integer> New(Isolate* isolate, int32_t value);
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:1989:25: note: candidate expects 2 arguments, 1 provided
In file included from ../src/Canvas.cc:18:0:
../src/JPEGStream.h:68:27: error: ‘GetCurrent’ is not a member of ‘v8::Context’
dest->closure->fn->Call(Context::GetCurrent()->Global(), 3, end_argv);
^
../src/Canvas.cc: In static member function ‘static void Canvas::Initialize(v8::Handle<v8::Object>)’:
../src/Canvas.cc:32:67: error: no matching function for call to ‘v8::FunctionTemplate::New(void (&)(const v8::FunctionCallbackInfo<v8::Value>&))’
Local<FunctionTemplate> ctor = FunctionTemplate::New(Canvas::New);
^
../src/Canvas.cc:32:67: note: candidate is:
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:3434:34: note: static v8::Local<v8::FunctionTemplate> v8::FunctionTemplate::New(v8::Isolate*, v8::FunctionCallback, v8::Handle<v8::Value>, v8::Handle<v8::Signature>, int)
static Local<FunctionTemplate> New(
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:3434:34: note: no known conversion for argument 1 from ‘void(const v8::FunctionCallbackInfo<v8::Value>&)’ to ‘v8::Isolate*’
../src/Canvas.cc:35:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
ctor->SetClassName(NanSymbol("Canvas"));
^
../src/Canvas.cc:44:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
proto->SetAccessor(NanSymbol("type"), GetType);
^
../src/Canvas.cc:45:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
proto->SetAccessor(NanSymbol("width"), GetWidth, SetWidth);
^
../src/Canvas.cc:46:22: error: ‘NewSymbol’ is not a member of ‘v8::String’
proto->SetAccessor(NanSymbol("height"), GetHeight, SetHeight);
^
../src/Canvas.cc:47:15: error: ‘NewSymbol’ is not a member of ‘v8::String’
target->Set(NanSymbol("Canvas"), ctor->GetFunction());
^
../src/Canvas.cc: In static member function ‘static void Canvas::New(const v8::FunctionCallbackInfo<v8::Value>&)’:
../src/Canvas.cc:60:51: error: ‘AsciiValue’ is not a member of ‘v8::String’
if (args[2]->IsString()) type = !strcmp("pdf", *String::AsciiValue(args[2]))
^
../src/Canvas.cc: In static member function ‘static void Canvas::GetType(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>&)’:
../src/Canvas.cc:75:36: error: ‘New’ is not a member of ‘v8::String’
NanReturnValue(String::New(canvas->isPDF() ? "pdf" : "image"));
^
../src/Canvas.cc:75:82: error: return-statement with a value, in function returning 'void' [-fpermissive]
NanReturnValue(String::New(canvas->isPDF() ? "pdf" : "image"));
^
../src/Canvas.cc: In static member function ‘static void Canvas::GetWidth(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>&)’:
../src/Canvas.cc:85:61: error: no matching function for call to ‘v8::Number::New(int&)’
NanReturnValue(Number::New(canvas->width));
^
../src/Canvas.cc:85:61: note: candidate is:
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:1976:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
static Local<Number> New(Isolate* isolate, double value);
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:1976:24: note: candidate expects 2 arguments, 1 provided
../src/Canvas.cc:85:62: error: return-statement with a value, in function returning 'void' [-fpermissive]
NanReturnValue(Number::New(canvas->width));
^
../src/Canvas.cc: In static member function ‘static void Canvas::GetHeight(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>&)’:
../src/Canvas.cc:108:62: error: no matching function for call to ‘v8::Number::New(int&)’
NanReturnValue(Number::New(canvas->height));
^
../src/Canvas.cc:108:62: note: candidate is:
In file included from ../src/Canvas.h:11:0,
from ../src/Canvas.cc:7:
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:1976:24: note: static v8::Local<v8::Number> v8::Number::New(v8::Isolate*, double)
static Local<Number> New(Isolate* isolate, double value);
^
/home/q2dg/.node-gyp/0.11.14/deps/v8/include/v8.h:1976:24: note: candidate expects 2 arguments, 1 provided
../src/Canvas.cc:108:63: error: return-statement with a value, in function returning 'void' [-fpermissive]
NanReturnValue(Number::New(canvas->height));
^
../src/Canvas.cc: At global scope:
../src/Canvas.cc:158:23: error: variable or field ‘ToBufferAsync’ declared void
Canvas::ToBufferAsync(uv_work_t *req) {
^
../src/Canvas.cc:158:23: error: ‘uv_work_t’ was not declared in this scope
../src/Canvas.cc:158:34: error: ‘req’ was not declared in this scope
Canvas::ToBufferAsync(uv_work_t *req) {
^
../src/Canvas.cc:184:28: error: variable or field ‘ToBufferAsyncAfter’ declared void
Canvas::ToBufferAsyncAfter(uv_work_t *req) {
^
../src/Canvas.cc:184:28: error: ‘uv_work_t’ was not declared in this scope
../src/Canvas.cc:184:39: error: ‘req’ was not declared in this scope
Canvas::ToBufferAsyncAfter(uv_work_t *req) {
^
../src/Canvas.cc:129:1: warning: ‘cairo_status_t toBuffer(void*, const uint8_t*, unsigned int)’ defined but not used [-Wunused-function]
toBuffer(void *c, const uint8_t *data, unsigned len) {
^
make: *** [Release/obj.target/canvas/src/Canvas.o] Error 1
make: Leaving directory `/home/q2dg/node_modules/ansi-canvas/node_modules/canvas/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/q2dg/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1059:12)
gyp ERR! System Linux 3.16.7-200.fc20.x86_64
gyp ERR! command "node" "/home/q2dg/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/q2dg/node_modules/ansi-canvas/node_modules/canvas
gyp ERR! node -v v0.11.14
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok