node-libcurl icon indicating copy to clipboard operation
node-libcurl copied to clipboard

`error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor`

Open multimeric opened this issue 5 months ago • 0 comments

Describe the bug

This is just a compilation error, I assume it relates to a change in the Node API.

I believe the key line is:

error ../../nan/nan.h:2594:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&)’

To Reproduce

With node 22.7:

npm i node-libcurl

Version information:

Version: 4.0.0 OS: Ubuntu 22.04 Node.js Version: v22.7.0

Additional context

Full error log here:

691 error code 1
692 error path /home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl
693 error command failed
694 error command sh -c node-pre-gyp install --fallback-to-build
695 error make: Entering directory '/home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl/build'
695 error   CXX(target) Release/obj.target/node_libcurl/src/node_libcurl.o
695 error make: Leaving directory '/home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl/build'
695 error Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl/lib/binding --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v127' (1)
696 error node-pre-gyp info it worked if it ends with ok
696 error node-pre-gyp info using [email protected]
696 error node-pre-gyp info using [email protected] | linux | x64
696 error (node:1702605) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
696 error (Use `node --trace-deprecation ...` to show where the warning was created)
696 error node-pre-gyp info check checked for "/home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl/lib/binding/node_libcurl.node" (not found)
696 error node-pre-gyp http GET https://github.com/JCMais/node-libcurl/releases/download/v4.0.0/node_libcurl-v4.0.0-node-v127-linux-x64-glibc.tar.gz
696 error node-pre-gyp ERR! install response status 404 Not Found on https://github.com/JCMais/node-libcurl/releases/download/v4.0.0/node_libcurl-v4.0.0-node-v127-linux-x64-glibc.tar.gz 
696 error node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v127 ABI, glibc) (falling back to source compile with node-gyp) 
696 error node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/JCMais/node-libcurl/releases/download/v4.0.0/node_libcurl-v4.0.0-node-v127-linux-x64-glibc.tar.gz 
696 error gyp info it worked if it ends with ok
696 error gyp info using [email protected]
696 error gyp info using [email protected] | linux | x64
696 error gyp info ok 
696 error gyp info it worked if it ends with ok
696 error gyp info using [email protected]
696 error gyp info using [email protected] | linux | x64
696 error gyp info find Python using Python version 3.10.12 found at "/tmp/tmp.z4xRkjC6XZ/venv/bin/python3"
696 error gyp info spawn /tmp/tmp.z4xRkjC6XZ/venv/bin/python3
696 error gyp info spawn args [
696 error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
696 error gyp info spawn args 'binding.gyp',
696 error gyp info spawn args '-f',
696 error gyp info spawn args 'make',
696 error gyp info spawn args '-I',
696 error gyp info spawn args '/home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl/build/config.gypi',
696 error gyp info spawn args '-I',
696 error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
696 error gyp info spawn args '-I',
696 error gyp info spawn args '/home/migwell/.cache/node-gyp/22.7.0/include/node/common.gypi',
696 error gyp info spawn args '-Dlibrary=shared_library',
696 error gyp info spawn args '-Dvisibility=default',
696 error gyp info spawn args '-Dnode_root_dir=/home/migwell/.cache/node-gyp/22.7.0',
696 error gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
696 error gyp info spawn args '-Dnode_lib_file=/home/migwell/.cache/node-gyp/22.7.0/<(target_arch)/node.lib',
696 error gyp info spawn args '-Dmodule_root_dir=/home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl',
696 error gyp info spawn args '-Dnode_engine=v8',
696 error gyp info spawn args '--depth=.',
696 error gyp info spawn args '--no-parallel',
696 error gyp info spawn args '--generator-output',
696 error gyp info spawn args 'build',
696 error gyp info spawn args '-Goutput_dir=.'
696 error gyp info spawn args ]
696 error gyp info ok 
696 error gyp info it worked if it ends with ok
696 error gyp info using [email protected]
696 error gyp info using [email protected] | linux | x64
696 error gyp info spawn make
696 error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
696 error In file included from ../src/Curl.h:13,
696 error                  from ../src/node_libcurl.cc:7:
696 error ../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, imp::Sig)’:
696 error ../../nan/nan.h:2548:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&)’
696 error  2548 |   tpl->SetAccessor(
696 error       |   ~~~~~~~~~~~~~~~~^
696 error  2549 |       name
696 error       |       ~~~~         
696 error  2550 |     , getter_
696 error       |     ~~~~~~~~~      
696 error  2551 |     , setter_
696 error       |     ~~~~~~~~~      
696 error  2552 |     , obj
696 error       |     ~~~~~          
696 error  2553 |     , settings
696 error       |     ~~~~~~~~~~     
696 error  2554 |     , attribute
696 error       |     ~~~~~~~~~~~    
696 error  2555 | #if (NODE_MODULE_VERSION < NODE_16_0_MODULE_VERSION)
696 error       | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
696 error  2556 |     , signature
696 error       |     ~~~~~~~~~~~    
696 error  2557 | #endif
696 error       | ~~~~~~             
696 error  2558 |   );
696 error       |   ~                
696 error In file included from /home/migwell/.cache/node-gyp/22.7.0/include/node/v8-function.h:15,
696 error                  from /home/migwell/.cache/node-gyp/22.7.0/include/node/v8.h:33,
696 error                  from /home/migwell/.cache/node-gyp/22.7.0/include/node/node.h:73,
696 error                  from ../../nan/nan.h:62:
696 error /home/migwell/.cache/node-gyp/22.7.0/include/node/v8-template.h:1049:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
696 error  1049 |   void SetAccessor(
696 error       |        ^~~~~~~~~~~
696 error /home/migwell/.cache/node-gyp/22.7.0/include/node/v8-template.h:1052:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
696 error  1052 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
696 error       |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
696 error /home/migwell/.cache/node-gyp/22.7.0/include/node/v8-template.h:1055:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
696 error  1055 |   void SetAccessor(
696 error       |        ^~~~~~~~~~~
696 error /home/migwell/.cache/node-gyp/22.7.0/include/node/v8-template.h:1058:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
696 error  1058 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
696 error       |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
696 error ../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
696 error ../../nan/nan.h:2594:19: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&)’
696 error  2594 |   tpl->SetAccessor(
696 error       |   ~~~~~~~~~~~~~~~~^
696 error  2595 |       name
696 error       |       ~~~~         
696 error  2596 |     , getter_
696 error       |     ~~~~~~~~~      
696 error  2597 |     , setter_
696 error       |     ~~~~~~~~~      
696 error  2598 |     , obj
696 error       |     ~~~~~          
696 error  2599 |     , settings
696 error       |     ~~~~~~~~~~     
696 error  2600 |     , attribute
696 error       |     ~~~~~~~~~~~    
696 error  2601 |   );
696 error       |   ~                
696 error /home/migwell/.cache/node-gyp/22.7.0/include/node/v8-template.h:1049:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
696 error  1049 |   void SetAccessor(
696 error       |        ^~~~~~~~~~~
696 error /home/migwell/.cache/node-gyp/22.7.0/include/node/v8-template.h:1052:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
696 error  1052 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
696 error       |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
696 error /home/migwell/.cache/node-gyp/22.7.0/include/node/v8-template.h:1055:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
696 error  1055 |   void SetAccessor(
696 error       |        ^~~~~~~~~~~
696 error /home/migwell/.cache/node-gyp/22.7.0/include/node/v8-template.h:1058:61: note:   no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’
696 error  1058 |       Local<Value> data = Local<Value>(), PropertyAttribute attribute = None,
696 error       |                                           ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
696 error ../src/node_libcurl.cc: At global scope:
696 error /home/migwell/.cache/node-gyp/22.7.0/include/node/node.h:1232:7: 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]
696 error  1232 |       (node::addon_register_func) (regfunc),                          \
696 error       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
696 error /home/migwell/.cache/node-gyp/22.7.0/include/node/node.h:1266:3: note: in expansion of macro ‘NODE_MODULE_X’
696 error  1266 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
696 error       |   ^~~~~~~~~~~~~
696 error ../src/node_libcurl.cc:68:1: note: in expansion of macro ‘NODE_MODULE’
696 error    68 | NODE_MODULE(node_libcurl, Init);
696 error       | ^~~~~~~~~~~
696 error make: *** [node_libcurl.target.mk:124: Release/obj.target/node_libcurl/src/node_libcurl.o] Error 1
696 error gyp ERR! build error 
696 error gyp ERR! stack Error: `make` failed with exit code: 2
696 error gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
696 error gyp ERR! System Linux 6.6.10-76060610-generic
696 error gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl/lib/binding/node_libcurl.node" "--module_name=node_libcurl" "--module_path=/home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl/lib/binding" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v127"
696 error gyp ERR! cwd /home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl
696 error gyp ERR! node -v v22.7.0
696 error gyp ERR! node-gyp -v v10.1.0
696 error gyp ERR! not ok 
696 error node-pre-gyp ERR! build error 
696 error node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl/lib/binding/node_libcurl.node --module_name=node_libcurl --module_path=/home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl/lib/binding --napi_version=9 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v127' (1)
696 error node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/migwell/Programming/overpass_gui/dictionary/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
696 error node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:520:28)
696 error node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
696 error node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
696 error node-pre-gyp ERR! System Linux 6.6.10-76060610-generic
696 error node-pre-gyp ERR! command "/usr/bin/node" "/home/migwell/Programming/overpass_gui/dictionary/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
696 error node-pre-gyp ERR! cwd /home/migwell/Programming/overpass_gui/dictionary/node_modules/node-libcurl
696 error node-pre-gyp ERR! node -v v22.7.0
696 error node-pre-gyp ERR! node-pre-gyp -v v1.0.11
696 error node-pre-gyp ERR! not ok

multimeric avatar Sep 06 '24 15:09 multimeric