Skip to content

ffi-napi 4.0.3 make error: no matching function for call to 'napi_add_finalizer' #289

Description

@yhaoyan

When I install lib
"ffi-napi":"^4.0.3"
got an error,

npm error In file included from ../src/ffi.cc:3:
npm error In file included from ../src/ffi.h:2:
npm error In file included from /Users/noahyoung/git/fastbot-pc-release/node_modules/node-addon-api/napi.h:2725:
npm error /Users/noahyoung/git/fastbot-pc-release/node_modules/node-addon-api/napi-inl.h:63:12: error: no matching function for call to 'napi_add_finalizer'
npm error   status = napi_add_finalizer(env, obj, data, finalizer, hint, nullptr);
npm error            ^~~~~~~~~~~~~~~~~~
npm error /Users/noahyoung/git/fastbot-pc-release/node_modules/node-addon-api/napi-inl.h:1965:29: note: in instantiation of function template specialization 'Napi::details::AttachData<Napi::details::CallbackData<void (*)(const Napi::CallbackInfo &), void>>' requested here
npm error     status = Napi::details::AttachData(env, *result, data);
npm error                             ^
npm error /Users/noahyoung/git/fastbot-pc-release/node_modules/node-addon-api/napi-inl.h:2021:24: note: in instantiation of function template specialization 'Napi::CreateFunction<Napi::details::CallbackData<void (*)(const Napi::CallbackInfo &), void>>' requested here
npm error   napi_status status = CreateFunction(env,
npm error                        ^
npm error ../src/ffi.cc:60:34: note: in instantiation of function template specialization 'Napi::Function::New<void (*)(const Napi::CallbackInfo &)>' requested here
npm error   target["ffi_call"] = Function::New(env, FFICall);
npm error                                  ^
npm error /Users/noahyoung/Library/Caches/node-gyp/22.9.0/include/node/js_native_api.h:525:1: note: candidate function not viable: no known conversion from 'napi_finalize' (aka 'void (*)(napi_env__ *, void *, void *)') to 'node_api_basic_finalize' (aka 'void (*)(const napi_env__ *, void *, void *)') for 4th argument
npm error napi_add_finalizer(napi_env env,
npm error ^
npm error 3 errors generated.
npm error make: *** [Release/obj.target/ffi_bindings/src/ffi.o] Error 1
npm error gyp ERR! build error
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/Users/noahyoung/.nvm/versions/node/v22.9.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:216:23)
npm error gyp ERR! System Darwin 23.6.0
npm error gyp ERR! command "/Users/noahyoung/.nvm/versions/node/v22.9.0/bin/node" "/Users/noahyoung/.nvm/versions/node/v22.9.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /Users/noahyoung/git/fastbot-pc-release/node_modules/ffi-napi
npm error gyp ERR! node -v v22.9.0
npm error gyp ERR! node-gyp -v v10.2.0
npm error gyp ERR! not ok

It seems related to this issue "balena-io/balena-cli#2721"

How can I get a latest version about "ffi-napi"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions