Open eng3 opened 2 years ago
I am getting an error trying to install:
# npm install node-openvpn npm ERR! code 1 npm ERR! path /code/node_modules/runas npm ERR! command failed npm ERR! command sh -c -- node-gyp rebuild npm ERR! make: Entering directory '/code/node_modules/runas/build' npm ERR! CXX(target) Release/obj.target/runas/src/main.o npm ERR! make: Leaving directory '/code/node_modules/runas/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@18.12.0 | linux | x64 npm ERR! gyp info find Python using Python version 3.9.2 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 '/code/node_modules/runas/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/18.12.0/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/18.12.0', 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/18.12.0/<(target_arch)/node.lib', npm ERR! gyp info spawn args '-Dmodule_root_dir=/code/node_modules/runas', 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/main.cc: In function 'void {anonymous}::Runas(const Nan::FunctionCallbackInfo<v8::Value>&)': npm ERR! ../src/main.cc:19:49: error: no matching function for call to 'v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)' npm ERR! 19 | std::string command(*String::Utf8Value(info[0])); npm ERR! | ^ npm ERR! In file included from /root/.cache/node-gyp/18.12.0/include/node/v8-object.h:11, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8-array-buffer.h:13, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8.h:24, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/node.h:73, npm ERR! from ../../nan/nan.h:60, npm ERR! from ../src/main.cc:1: npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-primitive.h:510:5: note: candidate: 'v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)' npm ERR! 510 | Utf8Value(Isolate* isolate, Local<v8::Value> obj); npm ERR! | ^~~~~~~~~ npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-primitive.h:510:5: note: candidate expects 2 arguments, 1 provided npm ERR! ../src/main.cc:27:53: error: no matching function for call to 'v8::Array::Get(uint32_t&)' npm ERR! 27 | std::string arg(*String::Utf8Value(v_args->Get(i))); npm ERR! | ^ npm ERR! In file included from /root/.cache/node-gyp/18.12.0/include/node/v8-array-buffer.h:13, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8.h:24, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/node.h:73, npm ERR! from ../../nan/nan.h:60, npm ERR! from ../src/main.cc:1: npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-object.h:290:43: note: candidate: 'v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, v8::Local<v8::Value>)' npm ERR! 290 | V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context, npm ERR! | ^~~ npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-object.h:290:43: note: candidate expects 2 arguments, 1 provided npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-object.h:293:43: note: candidate: 'v8::MaybeLocal<v8::Value> v8::Object::Get(v8::Local<v8::Context>, uint32_t)' npm ERR! 293 | V8_WARN_UNUSED_RESULT MaybeLocal<Value> Get(Local<Context> context, npm ERR! | ^~~ npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-object.h:293:43: note: candidate expects 2 arguments, 1 provided npm ERR! ../src/main.cc:32:47: error: no matching function for call to 'v8::Value::ToObject()' npm ERR! 32 | Local<Object> v_options = info[2]->ToObject(); npm ERR! | ^ npm ERR! In file included from /root/.cache/node-gyp/18.12.0/include/node/v8-primitive.h:11, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8-object.h:11, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8-array-buffer.h:13, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8.h:24, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/node.h:73, npm ERR! from ../../nan/nan.h:60, npm ERR! from ../src/main.cc:1: npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-value.h:372:44: note: candidate: 'v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const' npm ERR! 372 | V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject( npm ERR! | ^~~~~~~~ npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-value.h:372:44: note: candidate expects 1 argument, 0 provided npm ERR! ../src/main.cc:34:73: error: no matching function for call to 'v8::Value::BooleanValue()' npm ERR! 34 | if (GetProperty(v_options, "hide", &v_value) && v_value->BooleanValue()) npm ERR! | ^ npm ERR! In file included from /root/.cache/node-gyp/18.12.0/include/node/v8-primitive.h:11, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8-object.h:11, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8-array-buffer.h:13, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8.h:24, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/node.h:73, npm ERR! from ../../nan/nan.h:60, npm ERR! from ../src/main.cc:1: npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-value.h:408:8: note: candidate: 'bool v8::Value::BooleanValue(v8::Isolate*) const' npm ERR! 408 | bool BooleanValue(Isolate* isolate) const; npm ERR! | ^~~~~~~~~~~~ npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-value.h:408:8: note: candidate expects 1 argument, 0 provided npm ERR! ../src/main.cc:36:74: error: no matching function for call to 'v8::Value::BooleanValue()' npm ERR! 36 | if (GetProperty(v_options, "admin", &v_value) && v_value->BooleanValue()) npm ERR! | ^ npm ERR! In file included from /root/.cache/node-gyp/18.12.0/include/node/v8-primitive.h:11, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8-object.h:11, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8-array-buffer.h:13, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8.h:24, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/node.h:73, npm ERR! from ../../nan/nan.h:60, npm ERR! from ../src/main.cc:1: npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-value.h:408:8: note: candidate: 'bool v8::Value::BooleanValue(v8::Isolate*) const' npm ERR! 408 | bool BooleanValue(Isolate* isolate) const; npm ERR! | ^~~~~~~~~~~~ npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-value.h:408:8: note: candidate expects 1 argument, 0 provided npm ERR! ../src/main.cc:41:43: error: no matching function for call to 'v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)' npm ERR! 41 | std_input = *String::Utf8Value(v_value); npm ERR! | ^ npm ERR! In file included from /root/.cache/node-gyp/18.12.0/include/node/v8-object.h:11, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8-array-buffer.h:13, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8.h:24, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/node.h:73, npm ERR! from ../../nan/nan.h:60, npm ERR! from ../src/main.cc:1: npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-primitive.h:510:5: note: candidate: 'v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)' npm ERR! 510 | Utf8Value(Isolate* isolate, Local<v8::Value> obj); npm ERR! | ^~~~~~~~~ npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-primitive.h:510:5: note: candidate expects 2 arguments, 1 provided npm ERR! ../src/main.cc:45:45: error: no matching function for call to 'v8::Value::BooleanValue()' npm ERR! 45 | v_value->BooleanValue(); npm ERR! | ^ npm ERR! In file included from /root/.cache/node-gyp/18.12.0/include/node/v8-primitive.h:11, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8-object.h:11, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8-array-buffer.h:13, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/v8.h:24, npm ERR! from /root/.cache/node-gyp/18.12.0/include/node/node.h:73, npm ERR! from ../../nan/nan.h:60, npm ERR! from ../src/main.cc:1: npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-value.h:408:8: note: candidate: 'bool v8::Value::BooleanValue(v8::Isolate*) const' npm ERR! 408 | bool BooleanValue(Isolate* isolate) const; npm ERR! | ^~~~~~~~~~~~ npm ERR! /root/.cache/node-gyp/18.12.0/include/node/v8-value.h:408:8: note: candidate expects 1 argument, 0 provided npm ERR! ../src/main.cc: At global scope: npm ERR! ../src/main.cc:70:6: error: variable or field 'Init' declared void npm ERR! 70 | void Init(Handle<Object> exports) { npm ERR! | ^~~~ npm ERR! ../src/main.cc:70:11: error: 'Handle' was not declared in this scope npm ERR! 70 | void Init(Handle<Object> exports) { npm ERR! | ^~~~~~ npm ERR! ../src/main.cc:70:24: error: expected primary-expression before '>' token npm ERR! 70 | void Init(Handle<Object> exports) { npm ERR! | ^ npm ERR! ../src/main.cc:70:26: error: 'exports' was not declared in this scope npm ERR! 70 | void Init(Handle<Object> exports) { npm ERR! | ^~~~~~~ npm ERR! In file included from ../../nan/nan.h:60, npm ERR! from ../src/main.cc:1: npm ERR! ../src/main.cc:76:20: error: 'Init' was not declared in this scope npm ERR! 76 | NODE_MODULE(runas, Init) npm ERR! | ^~~~ npm ERR! /root/.cache/node-gyp/18.12.0/include/node/node.h:976:36: note: in definition of macro 'NODE_MODULE_X' npm ERR! 976 | (node::addon_register_func) (regfunc), \ npm ERR! | ^~~~~~~ npm ERR! ../src/main.cc:76:1: note: in expansion of macro 'NODE_MODULE' npm ERR! 76 | NODE_MODULE(runas, Init) npm ERR! | ^~~~~~~~~~~ npm ERR! ../src/main.cc:13:6: warning: 'void {anonymous}::Runas(const Nan::FunctionCallbackInfo<v8::Value>&)' defined but not used [-Wunused-function] npm ERR! 13 | void Runas(const Nan::FunctionCallbackInfo<Value>& info) { npm ERR! | ^~~~~ npm ERR! make: *** [runas.target.mk:115: Release/obj.target/runas/src/main.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 ChildProcess._handle.onexit (node:internal/child_process:291:12) npm ERR! gyp ERR! System Linux 5.10.0-19-amd64 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 /code/node_modules/runas npm ERR! gyp ERR! node -v v18.12.0 npm ERR! gyp ERR! node-gyp -v v9.1.0 npm ERR! gyp ERR! not ok
I am getting an error trying to install: