I'm trying to add ursa to my project by simply running npm i ursa and getting the following errors:
➜ npm i ursa
> ursa@0.9.4 install /Users/andrew/test/node_modules/ursa
> node-gyp rebuild
CXX(target) Release/obj.target/ursaNative/src/ursaNative.o
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:22:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
X(Boolean)
^~~~~~~~~~
../../nan/nan_converters_43_inl.h:18:23: note: expanded from macro 'X'
val->To ## TYPE(v8::Isolate::GetCurrent()->GetCurrentContext()) \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:2848:37: note: passing argument to parameter 'isolate' here
Local<Boolean> ToBoolean(Isolate* isolate) const;
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:22:1: error: no member named 'FromMaybe' in 'v8::Local<v8::Boolean>'
X(Boolean)
^~~~~~~~~~
../../nan/nan_converters_43_inl.h:19:12: note: expanded from macro 'X'
.FromMaybe(v8::Local<v8::TYPE>())); \
^
../../nan/nan_converters_43_inl.h:40:1: error: no viable conversion from 'Local<v8::Context>' to 'v8::Isolate *'
X(bool, Boolean)
^~~~~~~~~~~~~~~~
../../nan/nan_converters_43_inl.h:37:29: note: expanded from macro 'X'
return val->NAME ## Value(isolate->GetCurrentContext()); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:2858:30: note: passing argument to parameter 'isolate' here
bool BooleanValue(Isolate* isolate) const;
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
In file included from ../../nan/nan.h:202:
In file included from ../../nan/nan_converters.h:67:
../../nan/nan_converters_43_inl.h:40:1: error: no viable conversion from returned value of type 'bool' to function return type 'imp::ToFactory<bool>::return_t' (aka 'Maybe<bool>')
X(bool, Boolean)
^~~~~~~~~~~~~~~~
../../nan/nan_converters_43_inl.h:37:10: note: expanded from macro 'X'
return val->NAME ## Value(isolate->GetCurrentContext()); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:9968:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'bool' to 'const v8::Maybe<bool> &' for 1st argument
class Maybe {
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:9968:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'bool' to 'v8::Maybe<bool> &&' for 1st argument
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:10023:12: note: explicit constructor is not a candidate
explicit Maybe(const T& t) : has_value_(true), value_(t) {}
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:103:42: error: no viable conversion from 'v8::Isolate *' to 'Local<v8::Context>'
return scope.Escape(v8::Function::New( isolate
^~~~~~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:190:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'v8::Isolate *' to 'const v8::Local<v8::Context> &' for 1st argument
class Local {
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:190:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'v8::Isolate *' to 'v8::Local<v8::Context> &&' for 1st argument
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:194:13: note: candidate template ignored: could not match 'Local<type-parameter-0-0>' against 'v8::Isolate *'
V8_INLINE Local(Local<S> that)
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:337:22: note: explicit constructor is not a candidate
explicit V8_INLINE Local(T* that) : val_(that) {}
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:4446:22: note: passing argument to parameter 'context' here
Local<Context> context, FunctionCallback callback,
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
In file included from ../../nan/nan.h:203:
In file included from ../../nan/nan_new.h:189:
../../nan/nan_implementation_12_inl.h:337:37: error: too few arguments to function call, expected 2, have 1
return v8::StringObject::New(value).As<v8::StringObject>();
~~~~~~~~~~~~~~~~~~~~~ ^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:5854:23: note: 'New' declared here
static Local<Value> New(Isolate* isolate, Local<String> value);
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:839:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
return node::MakeCallback(
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/node.h:190:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/node.h:108:20: note: expanded from macro 'NODE_DEPRECATED'
__attribute__((deprecated(message))) declarator
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:854:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
return node::MakeCallback(
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/node.h:183:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/node.h:108:20: note: expanded from macro 'NODE_DEPRECATED'
__attribute__((deprecated(message))) declarator
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:869:18: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
return node::MakeCallback(
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/node.h:176:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/node.h:108:20: note: expanded from macro 'NODE_DEPRECATED'
__attribute__((deprecated(message))) declarator
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:916:53: error: too few arguments to function call, single argument 'context' was not specified
v8::Local<v8::String> string = from->ToString();
~~~~~~~~~~~~~~ ^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:2810:44: note: 'ToString' declared here
V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString(
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:916:29: error: no viable conversion from 'MaybeLocal<v8::String>' to 'v8::Local<v8::String>'
v8::Local<v8::String> string = from->ToString();
^ ~~~~~~~~~~~~~~~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:190:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'MaybeLocal<v8::String>' to 'const v8::Local<v8::String> &' for 1st argument
class Local {
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:190:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'MaybeLocal<v8::String>' to 'v8::Local<v8::String> &&' for 1st argument
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:194:13: note: candidate template ignored: could not match 'Local' against 'MaybeLocal'
V8_INLINE Local(Local<S> that)
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:337:22: note: explicit constructor is not a candidate
explicit V8_INLINE Local(T* that) : val_(that) {}
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:926:37: error: cannot initialize a parameter of type 'v8::Isolate *' with an lvalue of type 'char *'
length_ = string->WriteUtf8(str_, static_cast<int>(len), 0, flags);
^~~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3037:26: note: passing argument to parameter 'isolate' here
int WriteUtf8(Isolate* isolate, char* buffer, int length = -1,
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:1478:31: warning: 'MakeCallback' is deprecated: Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
return scope.Escape(node::MakeCallback(
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/node.h:190:1: note: 'MakeCallback' has been explicitly marked deprecated here
NODE_DEPRECATED("Use MakeCallback(..., async_context)",
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/node.h:108:20: note: expanded from macro 'NODE_DEPRECATED'
__attribute__((deprecated(message))) declarator
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:1538:28: error: no matching member function for call to 'Set'
New(persistentHandle)->Set(New(key).ToLocalChecked(), value);
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:1544:28: error: no matching member function for call to 'Set'
New(persistentHandle)->Set(key, value);
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:1550:28: error: no matching member function for call to 'Set'
New(persistentHandle)->Set(index, value);
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3670:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3673:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:1556:32: error: no matching member function for call to 'Get'
New(persistentHandle)->Get(New(key).ToLocalChecked()));
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3717:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3720:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:1562:48: error: no matching member function for call to 'Get'
return scope.Escape(New(persistentHandle)->Get(key));
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3717:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3720:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
../../nan/nan.h:1567:48: error: no matching member function for call to 'Get'
return scope.Escape(New(persistentHandle)->Get(index));
~~~~~~~~~~~~~~~~~~~~~~~^~~
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3717:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:3720:43: note: candidate function not viable: requires 2 arguments, but 1 was provided
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
In file included from ../../nan/nan.h:2365:
../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object>'
assert(persistent().IsNearDeath());
~~~~~~~~~~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
In file included from ../../nan/nan.h:2365:
../../nan/nan_object_wrap.h:67:18: error: no member named 'MarkIndependent' in 'Nan::Persistent<v8::Object>'
persistent().MarkIndependent();
~~~~~~~~~~~~ ^
../../nan/nan_object_wrap.h:124:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object>'
assert(wrap->handle_.IsNearDeath());
~~~~~~~~~~~~~ ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:99:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)
^
In file included from ../src/ursaNative.cc:3:
In file included from ../src/ursaNative.h:10:
In file included from ../../nan/nan.h:2456:
../../nan/nan_typedarray_contents.h:34:43: warning: 'GetContents' is deprecated: Use GetBackingStore. See http://crbug.com/v8/9908. [-Wdeprecated-declarations]
data = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:5272:3: note: 'GetContents' has been explicitly marked deprecated here
V8_DEPRECATE_SOON("Use GetBackingStore. See http://crbug.com/v8/9908.")
^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8config.h:402:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
^
../src/ursaNative.cc:208:34: error: too few arguments to function call, single argument 'isolate' was not specified
int length = str->Utf8Length();
~~~~~~~~~~~~~~~ ^
/Users/andrew/Library/Caches/node-gyp/14.18.1/include/node/v8.h:2977:7: note: 'Utf8Length' declared here
int Utf8Length(Isolate* isolate) const;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
5 warnings and 20 errors generated.
make: *** [Release/obj.target/ursaNative/src/ursaNative.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/andrew/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Darwin 21.1.0
gyp ERR! command "/Users/andrew/.nvm/versions/node/v14.18.1/bin/node" "/Users/andrew/.nvm/versions/node/v14.18.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/andrew/test/node_modules/ursa
gyp ERR! node -v v14.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN app@1.0.0 No description
npm WARN app@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ursa@0.9.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ursa@0.9.4 install 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! /Users/andrew/.npm/_logs/2021-10-18T12_33_27_457Z-debug.log
I'm trying to add
ursa
to my project by simply runningnpm i ursa
and getting the following errors:Setup:
node
v14.18.1
npm
v6.14.15
nvm
v0.39.0