node-ffi-napi / ref-napi

Turn Buffer instances into "pointers"
MIT License
123 stars 67 forks source link

undefined symbol: napi_set_instance_data #62

Open prakashnarkhede91 opened 3 years ago

prakashnarkhede91 commented 3 years ago

Hi @kanaka, @TooTallNate,@jcupitt ,@addaleax

I build one electron application with biometrics integration i used uareu-node npm

But it gives the error node: symbol lookup error: node_modules/ref-napi/prebuilds/linux-x64/node.napi.node: undefined symbol: napi_set_instance_data

Please help us

addaleax commented 3 years ago

@prakashnarkhede91 Most likely, you’re using an unsupported version of Node.js.

addaleax commented 3 years ago

Also, the next time you bulk-ping people who are not actively involved in the development of a project, you’re blocked.

Supriyaj29 commented 3 years ago

Hello,

Even I ran into this issue today. I am using ffi-napi, ref-napi, ref-array-di, ref-struct-di packages. My Implementation looks like this.

const ref = require('ref-napi'); const ffi = require('ffi-napi'); const struct = require('ref-struct-di')(ref); const refarray = require('ref-array-di')(ref); const charArray = refarray('char');

let crStatus = struct({ 'status': ref.types.int, 'msg': new charArray(128) });

let crStatusPtr = ref.refType(crStatus);

let crWrapper = ffi.Library('libXXX', { 'someFunction': ['int', [crStatusPtr, 'uint8*']], });

let retval = new crStatus(); if ( crWrapper.someFunction(retval.ref(), someValue) !== 0) { let errMsg = Buffer.from(ret.msg); console.log(errMsg); }

This same implementation is working fine with ref, ref-array, ref-struct and ffi on node 8. But after updating node version 12, I started getting lot of package deprecation errors. So I decided to update these package with the one which has node-12 support.

Is there anything missing in the implementation. I would really appreciate few pointers to debug this issue further.

Thanks.