Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fabric in Node 4 and 5 #2609

Closed
gomezbl opened this issue Nov 4, 2015 · 15 comments
Closed

Fabric in Node 4 and 5 #2609

gomezbl opened this issue Nov 4, 2015 · 15 comments
Labels

Comments

@gomezbl
Copy link

gomezbl commented Nov 4, 2015

Hi, trying to install fabric with nodejs 4.2.2 but with no success. Is that version of node already supported? Using to install "sudo npm install fabric -g" (with canvas already installed).

@davidagee
Copy link

👍

@marcovdijk
Copy link

Same here

@oscar-g
Copy link

oscar-g commented Nov 10, 2015

I was having problems with 4.2, as well. Take a look at package.json, though:

"engines": {
  "node": ">=0.4.0"
}

I couldn't get it installed on 4.2...so I used node version manager to install a previous version.

@inssein
Copy link
Contributor

inssein commented Nov 16, 2015

I had to upgrade jsdom first in order to get it to work with node version > 4.2. I do have an open pull request: #2547

@marcovdijk
Copy link

Any news on this?

@kangax kangax changed the title Fabric in node 4.2.2 Fabric in node 4 and 5 Dec 27, 2015
@kangax kangax changed the title Fabric in node 4 and 5 Fabric in Node 4 and 5 Dec 27, 2015
@kangax kangax added the feature label Dec 27, 2015
@saran110313
Copy link

i have add in image function in fabric.js. but free drawing function normal using in node.js. but first i have add in image file and second i have add in path function.but path function move to other position so i remove the image file in server side.how to solve this problem.

@esatterwhite
Copy link

EDIT: nevermind, I see the master branch updates canvas to 1.2

I get compilation errors from canvas when trying to install with 4.2, But I can install canvas 1.2 & 1.3 manually with out a problem

In file included from ../src/Canvas.h:22:0,
                 from ../src/Canvas.cc:7:
../node_modules/nan/nan.h: In function 'v8::Local<v8::Signature> NanNew(v8::Handle<v8::FunctionTemplate>, int, v8::Handle<v8::FunctionTemplate>*)':
../node_modules/nan/nan.h:342:78: error: no matching function for call to 'v8::Signature::New(v8::Isolate*, v8::Handle<v8::FunctionTemplate>&, int&, v8::Handle<v8::FunctionTemplate>*&)'
     return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);
                                                                              ^
../node_modules/nan/nan.h:342:78: note: candidate is:
In file included from ../src/Canvas.h:11:0,
                 from ../src/Canvas.cc:7:
/root/.node-gyp/4.2.4/include/node/v8.h:4675:27: note: static v8::Local<v8::Signature> v8::Signature::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>)
   static Local<Signature> New(
                           ^
/root/.node-gyp/4.2.4/include/node/v8.h:4675:27: note:   candidate expects 2 arguments, 4 provided
In file included from ../src/Canvas.h:22:0,
                 from ../src/Canvas.cc:7:
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:424:3: error: redefinition of 'v8::Local<T> NanNew(P) [with T = v8::StringObject; P = v8::Local<v8::String>]'
   NanNew<v8::StringObject, v8::Handle<v8::String> >(
   ^
../node_modules/nan/nan.h:417:3: error: 'v8::Local<T> NanNew(P) [with T = v8::StringObject; P = v8::Local<v8::String>]' previously declared here
   NanNew<v8::StringObject, v8::Local<v8::String> >(
   ^
../node_modules/nan/nan.h:442:36: error: redefinition of 'template<class T> v8::Local<v8::RegExp> NanNew(v8::Local<v8::String>, v8::RegExp::Flags)'
   NAN_INLINE v8::Local<v8::RegExp> NanNew(
                                    ^
../node_modules/nan/nan.h:436:36: error: 'template<class T> v8::Local<v8::RegExp> NanNew(v8::Handle<v8::String>, v8::RegExp::Flags)' previously declared here
   NAN_INLINE v8::Local<v8::RegExp> NanNew(
                                    ^
../node_modules/nan/nan.h:454:36: error: redefinition of 'template<class T, class P> v8::Local<v8::RegExp> NanNew(v8::Local<v8::String>, v8::RegExp::Flags)'
   NAN_INLINE v8::Local<v8::RegExp> NanNew(
                                    ^
../node_modules/nan/nan.h:448:36: error: 'template<class T, class P> v8::Local<v8::RegExp> NanNew(v8::Handle<v8::String>, v8::RegExp::Flags)' previously declared here
   NAN_INLINE v8::Local<v8::RegExp> NanNew(
                                    ^
../node_modules/nan/nan.h:623:19: error: 'NanNew' declared as an 'inline' variable
       v8::String::ExternalAsciiStringResource *resource) {
                   ^
../node_modules/nan/nan.h:623:19: warning: 'always_inline' attribute ignored [-Wattributes]
../node_modules/nan/nan.h:623:19: error: 'v8::Local<v8::String> NanNew' redeclared as different kind of symbol
../node_modules/nan/nan.h:617:36: error: previous declaration of 'v8::Local<v8::String> NanNew(v8::String::ExternalStringResource*)'
   NAN_INLINE v8::Local<v8::String> NanNew(
                                    ^
../node_modules/nan/nan.h:623:7: error: 'ExternalAsciiStringResource' is not a member of 'v8::String'
       v8::String::ExternalAsciiStringResource *resource) {
       ^
../node_modules/nan/nan.h:623:48: error: 'resource' was not declared in this scope
       v8::String::ExternalAsciiStringResource *resource) {
                                                ^
../node_modules/nan/nan.h:637:27: error: redefinition of 'template<class T> v8::Local<T> _NanEscapeScopeHelper(v8::Local<T>)'
   NAN_INLINE v8::Local<T> _NanEscapeScopeHelper(v8::Local<T> val) {
                           ^
../node_modules/nan/nan.h:632:27: error: 'template<class T> v8::Local<T> _NanEscapeScopeHelper(v8::Handle<T>)' previously declared here
   NAN_INLINE v8::Local<T> _NanEscapeScopeHelper(v8::Handle<T> val) {
                           ^
../node_modules/nan/nan.h:889:13: error: 'node::smalloc' has not been declared
     , node::smalloc::FreeCallback callback
             ^
../node_modules/nan/nan.h:889:35: error: expected ',' or '...' before 'callback'
     , node::smalloc::FreeCallback callback
                                   ^
../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)':
../node_modules/nan/nan.h:893:50: error: 'callback' was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../node_modules/nan/nan.h:893:60: error: 'hint' was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)':
../node_modules/nan/nan.h:900:67: error: call of overloaded 'New(v8::Isolate*, const char*&, uint32_t&)' is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../node_modules/nan/nan.h:900:67: note: candidates are:
In file included from ../node_modules/nan/nan.h:179:0,
                 from ../src/Canvas.h:22,
                 from ../src/Canvas.cc:7:
/root/.node-gyp/4.2.4/include/node/node_buffer.h:31:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/root/.node-gyp/4.2.4/include/node/node_buffer.h:31:40: note:   no known conversion for argument 3 from 'uint32_t {aka unsigned int}' to 'node::encoding'
/root/.node-gyp/4.2.4/include/node/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
 NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
                                        ^
/root/.node-gyp/4.2.4/include/node/node_buffer.h:43:40: note:   no known conversion for argument 2 from 'const char*' to 'char*'
In file included from ../src/Canvas.h:22:0,
                 from ../src/Canvas.cc:7:
../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(uint32_t)':
../node_modules/nan/nan.h:904:61: error: could not convert 'node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))' from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object>'
     return node::Buffer::New(v8::Isolate::GetCurrent(), size);
                                                             ^
../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanBufferUse(char*, uint32_t)':
../node_modules/nan/nan.h:911:12: error: 'Use' is not a member of 'node::Buffer'
     return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
            ^
../node_modules/nan/nan.h: In function 'bool _NanGetExternalParts(v8::Handle<v8::Value>, const char**, size_t*)':
../node_modules/nan/nan.h:1993:12: error: 'class v8::String' has no member named 'IsExternalAscii'
   if (str->IsExternalAscii()) {
            ^
../node_modules/nan/nan.h:1994:11: error: 'ExternalAsciiStringResource' in 'class v8::String' does not name a type
     const v8::String::ExternalAsciiStringResource* ext;
           ^
../node_modules/nan/nan.h:1995:5: error: 'ext' was not declared in this scope
     ext = str->GetExternalAsciiStringResource();
     ^
../node_modules/nan/nan.h:1995:16: error: 'class v8::String' has no member named 'GetExternalAsciiStringResource'
     ext = str->GetExternalAsciiStringResource();
                ^
../node_modules/nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)':
../node_modules/nan/nan.h:901:3: warning: control reaches end of non-void function [-Wreturn-type]
   }

@nadirabid
Copy link

👍

@Krb686
Copy link

Krb686 commented Mar 22, 2016

Yep, same compilation issues as esatterwhite from node 4.4

@let4be
Copy link

let4be commented Mar 29, 2016

Guys... it's been a while
Any success running fabric on node 5.9.0?

@teewuane
Copy link

teewuane commented Apr 1, 2016

Is the general consensus that you must to use an older (0.12) version of node.js for fabric to work?

@inssein
Copy link
Contributor

inssein commented Apr 1, 2016

#2547 - I mentioned it up above where I got this to work with node 4.2.0.

It can most likely work with the latest version of node, but I haven't had to try it yet,

@nadirabid
Copy link

Similar issue when try to build canvas:

  SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node
  COPY Release/canvas-postbuild.node
  CXX(target) Release/obj.target/canvas/src/Canvas.o
In file included from ../src/Canvas.h:22:0,
                 from ../src/Canvas.cc:7:
../../nan/nan.h: In function ‘v8::Local<v8::Signature> NanNew(v8::Handle<v8::FunctionTemplate>, int, v8::Handle<v8::FunctionTemplate>*)’:
../../nan/nan.h:342:78: error: no matching function for call to ‘v8::Signature::New(v8::Isolate*, v8::Handle<v8::FunctionTemplate>&, int&, v8::Handle<v8::FunctionTemplate>*&)’
     return v8::Signature::New(v8::Isolate::GetCurrent(), receiver, argc, argv);
                                                                              ^
../../nan/nan.h:342:78: note: candidate is:
In file included from ../src/Canvas.h:11:0,
                 from ../src/Canvas.cc:7:
/home/nadirmuzaffar/.node-gyp/5.8.0/include/node/v8.h:4674:27: note: static v8::Local<v8::Signature> v8::Signature::New(v8::Isolate*, v8::Local<v8::FunctionTemplate>)
   static Local<Signature> New(
                           ^
/home/nadirmuzaffar/.node-gyp/5.8.0/include/node/v8.h:4674:27: note:   candidate expects 2 arguments, 4 provided
In file included from ../src/Canvas.h:22:0,
                 from ../src/Canvas.cc:7:
../../nan/nan.h: At global scope:
../../nan/nan.h:424:3: error: redefinition of ‘v8::Local<T> NanNew(P) [with T = v8::StringObject; P = v8::Local<v8::String>]’
   NanNew<v8::StringObject, v8::Handle<v8::String> >(
   ^
../../nan/nan.h:417:3: error: ‘v8::Local<T> NanNew(P) [with T = v8::StringObject; P = v8::Local<v8::String>]’ previously declared here
   NanNew<v8::StringObject, v8::Local<v8::String> >(
   ^
../../nan/nan.h:442:36: error: redefinition of ‘template<class T> v8::Local<v8::RegExp> NanNew(v8::Local<v8::String>, v8::RegExp::Flags)’
   NAN_INLINE v8::Local<v8::RegExp> NanNew(
                                    ^
../../nan/nan.h:436:36: error: ‘template<class T> v8::Local<v8::RegExp> NanNew(v8::Handle<v8::String>, v8::RegExp::Flags)’ previously declared here
   NAN_INLINE v8::Local<v8::RegExp> NanNew(
                                    ^
../../nan/nan.h:454:36: error: redefinition of ‘template<class T, class P> v8::Local<v8::RegExp> NanNew(v8::Local<v8::String>, v8::RegExp::Flags)’
   NAN_INLINE v8::Local<v8::RegExp> NanNew(
                                    ^
../../nan/nan.h:448:36: error: ‘template<class T, class P> v8::Local<v8::RegExp> NanNew(v8::Handle<v8::String>, v8::RegExp::Flags)’ previously declared here
   NAN_INLINE v8::Local<v8::RegExp> NanNew(
                                    ^
../../nan/nan.h:623:19: error: ‘NanNew’ declared as an ‘inline’ variable
       v8::String::ExternalAsciiStringResource *resource) {
                   ^
../../nan/nan.h:623:19: warning: ‘always_inline’ attribute ignored [-Wattributes]
../../nan/nan.h:623:19: error: ‘v8::Local<v8::String> NanNew’ redeclared as different kind of symbol
../../nan/nan.h:617:36: error: previous declaration of ‘v8::Local<v8::String> NanNew(v8::String::ExternalStringResource*)’
   NAN_INLINE v8::Local<v8::String> NanNew(
                                    ^
../../nan/nan.h:623:7: error: ‘ExternalAsciiStringResource’ is not a member of ‘v8::String’
       v8::String::ExternalAsciiStringResource *resource) {
       ^
../../nan/nan.h:623:48: error: ‘resource’ was not declared in this scope
       v8::String::ExternalAsciiStringResource *resource) {
                                                ^
../../nan/nan.h:637:27: error: redefinition of ‘template<class T> v8::Local<T> _NanEscapeScopeHelper(v8::Local<T>)’
   NAN_INLINE v8::Local<T> _NanEscapeScopeHelper(v8::Local<T> val) {
                           ^
../../nan/nan.h:632:27: error: ‘template<class T> v8::Local<T> _NanEscapeScopeHelper(v8::Handle<T>)’ previously declared here
   NAN_INLINE v8::Local<T> _NanEscapeScopeHelper(v8::Handle<T> val) {
                           ^
../../nan/nan.h:889:13: error: ‘node::smalloc’ has not been declared
     , node::smalloc::FreeCallback callback
             ^
../../nan/nan.h:889:35: error: expected ‘,’ or ‘...’ before ‘callback’
     , node::smalloc::FreeCallback callback
                                   ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’:
../../nan/nan.h:893:50: error: ‘callback’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                  ^
../../nan/nan.h:893:60: error: ‘hint’ was not declared in this scope
         v8::Isolate::GetCurrent(), data, length, callback, hint);
                                                            ^
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’:
../../nan/nan.h:900:67: error: call of overloaded ‘New(v8::Isolate*, const char*&, uint32_t&)’ is ambiguous
     return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
                                                                   ^
../../nan/nan.h:900:67: note: candidates are:
In file included from ../../nan/nan.h:179:0,
                 from ../src/Canvas.h:22,
                 from ../src/Canvas.cc:7:

According to the error output, this node version is v5.8.0 and node-gyp is v3.3.1

gyp ERR! node -v v5.8.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 

@inssein
Copy link
Contributor

inssein commented Apr 1, 2016

@nadirabid did you try to use the PR I just mentioned above?

@asturur
Copy link
Member

asturur commented Apr 7, 2016

fixed with #2872

@asturur asturur closed this as completed Apr 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests