microsoft / VoTT

Visual Object Tagging Tool: An electron app for building end to end Object Detection Models from Images and Videos.
MIT License
4.28k stars 834 forks source link

error: cannot convert ‘v8::Local<v8::Context>’ to ‘v8::Isolate*’ #960

Open sirus20x6 opened 4 years ago

sirus20x6 commented 4 years ago
 Release/obj.target/libsass/src/libsass/src/subset_map.o Release/obj.target/libsass/src/libsass/src/to_c.o Release/obj.target/libsass/src/libsass/src/to_value.o Release/obj.target/libsass/src/libsass/src/units.o Release/obj.target/libsass/src/libsass/src/utf8_string.o Release/obj.target/libsass/src/libsass/src/util.o Release/obj.target/libsass/src/libsass/src/values.o
  rm -rf "Release/sass.a" && cp -af "Release/obj.target/src/sass.a" "Release/sass.a"
  g++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-D__STDC_FORMAT_MACROS' '-DBUILDING_NODE_EXTENSION' -I/home/sirus/.node-gyp/14.2.0/include/node -I/home/sirus/.node-gyp/14.2.0/src -I/home/sirus/.node-gyp/14.2.0/deps/openssl/config -I/home/sirus/.node-gyp/14.2.0/deps/openssl/openssl/include -I/home/sirus/.node-gyp/14.2.0/deps/uv/include -I/home/sirus/.node-gyp/14.2.0/deps/zlib -I/home/sirus/.node-gyp/14.2.0/deps/v8/include -I../../nan -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -std=c++0x -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw   -c -o Release/obj.target/binding/src/binding.o ../src/binding.cpp
In file included from ../../nan/nan_converters.h:67,
                 from ../../nan/nan.h:222,
                 from ../src/binding.cpp:1:
../../nan/nan_converters_43_inl.h: In static member function ‘static Nan::imp::ToFactoryBase<v8::Boolean>::return_t Nan::imp::ToFactory<v8::Boolean>::convert(v8::Local<v8::Value>)’:
../../nan/nan_converters_43_inl.h:18:49: error: cannot convert ‘v8::Local<v8::Context>’ to ‘v8::Isolate*’
   18 |       val->To ## TYPE(isolate->GetCurrentContext())                            \
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                 |
      |                                                 v8::Local<v8::Context>
../../nan/nan_converters_43_inl.h:22:1: note: in expansion of macro ‘X’
   22 | X(Boolean)
      | ^
In file included from /home/sirus/.node-gyp/14.2.0/include/node/node.h:67,
                 from ../../nan/nan.h:53,
                 from ../src/binding.cpp:1:
/home/sirus/.node-gyp/14.2.0/include/node/v8.h:2845:37: note:   initializing argument 1 of ‘v8::Local<v8::Boolean> v8::Value::ToBoolean(v8::Isolate*) const’
 2845 |   Local<Boolean> ToBoolean(Isolate* isolate) const;
      |                            ~~~~~~~~~^~~~~~~
In file included from ../../nan/nan_converters.h:67,
                 from ../../nan/nan.h:222,
                 from ../src/binding.cpp:1:
../../nan/nan_converters_43_inl.h: In static member function ‘static Nan::imp::ValueFactoryBase<bool>::return_t Nan::imp::ToFactory<bool>::convert(v8::Local<v8::Value>)’:
../../nan/nan_converters_43_inl.h:37:55: error: cannot convert ‘v8::Local<v8::Context>’ to ‘v8::Isolate*’
   37 |   return val->NAME ## Value(isolate->GetCurrentContext());                     \
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                       |
      |                                                       v8::Local<v8::Context>
../../nan/nan_converters_43_inl.h:40:1: note: in expansion of macro ‘X’
   40 | X(bool, Boolean)
      | ^
In file included from /home/sirus/.node-gyp/14.2.0/include/node/node.h:67,
                 from ../../nan/nan.h:53,
                 from ../src/binding.cpp:1:
/home/sirus/.node-gyp/14.2.0/include/node/v8.h:2855:30: note:   initializing argument 1 of ‘bool v8::Value::BooleanValue(v8::Isolate*) const’
 2855 |   bool BooleanValue(Isolate* isolate) const;
      |                     ~~~~~~~~~^~~~~~~
In file included from ../../nan/nan_new.h:189,
                 from ../../nan/nan.h:223,
                 from ../src/binding.cpp:1:
../../nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::StringObject>::return_t Nan::imp::Factory<v8::StringObject>::New(v8::Local<v8::String>)’:
../../nan/nan_implementation_12_inl.h:356:37: error: no matching function for call to ‘v8::StringObject::New(v8::Local<v8::String>&)’
  356 |   return v8::StringObject::New(value).As<v8::StringObject>();
      |                                     ^
In file included from /home/sirus/.node-gyp/14.2.0/include/node/node.h:67,
                 from ../../nan/nan.h:53,
                 from ../src/binding.cpp:1:
/home/sirus/.node-gyp/14.2.0/include/node/v8.h:5784:23: note: candidate: ‘static v8::Local<v8::Value> v8::StringObject::New(v8::Isolate*, v8::Local<v8::String>)’
 5784 |   static Local<Value> New(Isolate* isolate, Local<String> value);
      |                       ^~~
/home/sirus/.node-gyp/14.2.0/include/node/v8.h:5784:23: note:   candidate expects 2 arguments, 1 provided
In file included from ../../nan/nan_new.h:189,
                 from ../../nan/nan.h:223,
                 from ../src/binding.cpp:1:
../../nan/nan_implementation_12_inl.h:356:58: error: expected primary-expression before ‘>’ token
  356 |   return v8::StringObject::New(value).As<v8::StringObject>();
      |                                                          ^
../../nan/nan_implementation_12_inl.h:356:60: error: expected primary-expression before ‘)’ token
  356 |   return v8::StringObject::New(value).As<v8::StringObject>();
      |                                                            ^
In file included from ../src/binding.cpp:1:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2232:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2232 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
In file included from /usr/include/c++/9.3.0/cassert:44,
                 from /home/sirus/.node-gyp/14.2.0/include/node/node_object_wrap.h:26,
                 from ../../nan/nan.h:55,
                 from ../src/binding.cpp:1:
../../nan/nan_object_wrap.h: In destructor ‘virtual Nan::ObjectWrap::~ObjectWrap()’:
../../nan/nan_object_wrap.h:24:25: error: ‘class Nan::Persistent<v8::Object>’ has no member named ‘IsNearDeath’
   24 |     assert(persistent().IsNearDeath());
      |                         ^~~~~~~~~~~
../../nan/nan_object_wrap.h: In static member function ‘static void Nan::ObjectWrap::WeakCallback(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’:
../../nan/nan_object_wrap.h:127:26: error: ‘class Nan::Persistent<v8::Object>’ has no member named ‘IsNearDeath’
  127 |     assert(wrap->handle_.IsNearDeath());
      |                          ^~~~~~~~~~~
../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cpp:284:98: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
  284 |  uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
      |                                                                                  ^~~~~~~~~~~~

../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render_file(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/binding.cpp:320:98: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
  320 |  uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
      |                                                                                  ^~~~~~~~~~~~

In file included from ../../nan/nan.h:53,
                 from ../src/binding.cpp:1:
../src/binding.cpp: At global scope:
/home/sirus/.node-gyp/14.2.0/include/node/node.h:731:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  731 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/home/sirus/.node-gyp/14.2.0/include/node/node.h:765:3: note: in expansion of macro ‘NODE_MODULE_X’
  765 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/binding.cpp:358:1: note: in expansion of macro ‘NODE_MODULE’
  358 | NODE_MODULE(binding, RegisterModule);
      | ^~~~~~~~~~~
make: *** [binding.target.mk:127: Release/obj.target/binding/src/binding.o] Error 1
make: Leaving directory '/mnt/card/code/git/VoTT/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/mnt/card/code/git/VoTT/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.6.11-1-MANJARO
gyp ERR! command "/usr/bin/node" "/mnt/card/code/git/VoTT/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /mnt/card/code/git/VoTT/node_modules/node-sass
gyp ERR! node -v v14.2.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.11.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sirus/.npm/_logs/2020-05-08T04_58_53_443Z-debug.log
CarlHybird commented 4 years ago

You need a version of node-sass that is compatible with your version of node. For me, version 4.12.0 worked which is slightly more recent than your 4.11.0. I did "npm install node-sass@4.12.0 --save --force" which updated the appropriate line inside pakage.json but there is probably a better way of doing that, and it would be good if the project worked automatically by installing a working version of the library.