Skip to content

Support for newer node versions #14

@Sir-hennihau

Description

@Sir-hennihau

Is there any support planned for newer node versions?

Right now I can't even install the package, even if I would really like to.

The install fails like that

root@49d35f2c54fb:/app# npm install word2vector --save
npm ERR! code 1
npm ERR! path /app/node_modules/word2vector
npm ERR! command failed
npm ERR! command sh -c -- node-gyp rebuild
npm ERR! make: Entering directory '/app/node_modules/word2vector/build'
npm ERR!   CXX(target) Release/obj.target/w2vLeeXun/src/w2vLeeXun.o
npm ERR! make: Leaving directory '/app/node_modules/word2vector/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.1.0
npm ERR! gyp info using node@16.20.2 | linux | x64
npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/app/node_modules/word2vector/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/root/.cache/node-gyp/16.20.2/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/16.20.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/16.20.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/app/node_modules/word2vector',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! ../src/w2vLeeXun.cc: In function 'void demo::getVectors(const v8::FunctionCallbackInfo<v8::Value>&)':
npm ERR! ../src/w2vLeeXun.cc:211:5: error: 'Handle' was not declared in this scope
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!      ^~~~~~
npm ERR! ../src/w2vLeeXun.cc:211:5: note: suggested alternative: 'daddl'
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!      ^~~~~~
npm ERR!      daddl
npm ERR! ../src/w2vLeeXun.cc:211:18: error: expected primary-expression before '>' token
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!                   ^
npm ERR! ../src/w2vLeeXun.cc:211:20: error: 'word_obj' was not declared in this scope
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!                     ^~~~~~~~
npm ERR! ../src/w2vLeeXun.cc:214:41: error: no matching function for call to 'v8::Array::Get(Nan::imp::FactoryBase<v8::Number>::return_t)'
npm ERR!        word_obj_array->Get(New<Number>(w))->ToString()
npm ERR!                                          ^
npm ERR! In file included from /root/.cache/node-gyp/16.20.2/include/node/node.h:73,
npm ERR!                  from ../src/w2vLeeXun.cc:2:
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4007:43: note: candidate: 'v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)'
npm ERR!    V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!                                            ^~~
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4007:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4010:43: note: candidate: 'v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)'
npm ERR!    V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!                                            ^~~
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4010:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! ../src/w2vLeeXun.cc:216:63: error: no matching function for call to 'v8::Array::Get(Nan::imp::FactoryBase<v8::Number>::return_t)'
npm ERR!      strcpy(st1, *Utf8String(word_obj_array->Get(New<Number>(w))));
npm ERR!                                                                ^
npm ERR! In file included from /root/.cache/node-gyp/16.20.2/include/node/node.h:73,
npm ERR!                  from ../src/w2vLeeXun.cc:2:
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4007:43: note: candidate: 'v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)'
npm ERR!    V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!                                            ^~~
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4007:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4010:43: note: candidate: 'v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)'
npm ERR!    V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!                                            ^~~
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4010:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! ../src/w2vLeeXun.cc:251:70: error: no matching function for call to 'v8::Array::Set(long long int&, Nan::imp::FactoryBase<v8::Number>::return_t)'
npm ERR!        for(a = 0; a < v_size; a++) v_array->Set(a, New<Number>(vec[a]));
npm ERR!                                                                       ^
npm ERR! In file included from /root/.cache/node-gyp/16.20.2/include/node/node.h:73,
npm ERR!                  from ../src/w2vLeeXun.cc:2:
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:3961:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)'
npm ERR!    V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
npm ERR!                                      ^~~
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:3961:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:3964:37: note: candidate: 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)'
npm ERR!    V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
npm ERR!                                      ^~~
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:3964:37: note:   candidate expects 3 arguments, 2 provided
npm ERR! ../src/w2vLeeXun.cc: In function 'void demo::getSimilarWords(const v8::FunctionCallbackInfo<v8::Value>&)':
npm ERR! ../src/w2vLeeXun.cc:335:5: error: 'Handle' was not declared in this scope
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!      ^~~~~~
npm ERR! ../src/w2vLeeXun.cc:335:5: note: suggested alternative: 'daddl'
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!      ^~~~~~
npm ERR!      daddl
npm ERR! ../src/w2vLeeXun.cc:335:18: error: expected primary-expression before '>' token
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!                   ^
npm ERR! ../src/w2vLeeXun.cc:335:20: error: 'word_obj' was not declared in this scope
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!                     ^~~~~~~~
npm ERR! ../src/w2vLeeXun.cc: In function 'void demo::getNeighbors(const v8::FunctionCallbackInfo<v8::Value>&)':
npm ERR! ../src/w2vLeeXun.cc:357:85: error: no matching function for call to 'v8::Array::Get(Nan::imp::FactoryBase<v8::Number>::return_t)'
npm ERR!    for (a = 0; a < v_size; a++) vec[a] = atof(*Utf8String(vectors->Get(New<Number>(a))));// 0.0 when invalid
npm ERR!                                                                                      ^
npm ERR! In file included from /root/.cache/node-gyp/16.20.2/include/node/node.h:73,
npm ERR!                  from ../src/w2vLeeXun.cc:2:
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4007:43: note: candidate: 'v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)'
npm ERR!    V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!                                            ^~~
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4007:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4010:43: note: candidate: 'v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)'
npm ERR!    V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context,
npm ERR!                                            ^~~
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/v8.h:4010:43: note:   candidate expects 2 arguments, 1 provided
npm ERR! ../src/w2vLeeXun.cc:387:5: error: 'Handle' was not declared in this scope
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!      ^~~~~~
npm ERR! ../src/w2vLeeXun.cc:387:5: note: suggested alternative: 'daddl'
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!      ^~~~~~
npm ERR!      daddl
npm ERR! ../src/w2vLeeXun.cc:387:18: error: expected primary-expression before '>' token
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!                   ^
npm ERR! ../src/w2vLeeXun.cc:387:20: error: 'word_obj' was not declared in this scope
npm ERR!      Handle<Object> word_obj = New<Object>();
npm ERR!                     ^~~~~~~~
npm ERR! In file included from ../src/w2vLeeXun.cc:2:
npm ERR! ../src/w2vLeeXun.cc: At global scope:
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/node.h:887:43: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>)' to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
npm ERR!        (node::addon_register_func) (regfunc),                          \
npm ERR!                                            ^
npm ERR! /root/.cache/node-gyp/16.20.2/include/node/node.h:921:3: note: in expansion of macro 'NODE_MODULE_X'
npm ERR!    NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm ERR!    ^~~~~~~~~~~~~
npm ERR! ../src/w2vLeeXun.cc:404:1: note: in expansion of macro 'NODE_MODULE'
npm ERR!  NODE_MODULE(w2vLeeXun, init)
npm ERR!  ^~~~~~~~~~~
npm ERR! make: *** [w2vLeeXun.target.mk:113: Release/obj.target/w2vLeeXun/src/w2vLeeXun.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Linux 5.19.0-43-generic
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /app/node_modules/word2vector
npm ERR! gyp ERR! node -v v16.20.2
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/_logs/2024-02-27T19_51_55_208Z-debug-0.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions