Skip to main content

Questions tagged [node-addon-api]

node-addon-api is the C++ wrapper for N-API, the ABI stable library to build addons for Node.js.

node-addon-api
0 votes
0 answers
12 views

How to Resolve "LNK1107: invalid or corrupt file" Error When Linking MuPDF C library with Node.js Addon?

I've built MuPDF with the Dynamic Libr ary(.dll) configuration and can see libmupdf.dll and libmupdf.exp files in ....mupdf/platform/win32/x64/Release/ //binding.gyp :- { "targets": [ ...
Mohib Najam's user avatar
0 votes
0 answers
26 views

Exporting function with Napi::Object return type by Napi::InstanceWrap<T>::InstanceMethod using node-addon-api

Preface: I have a CPP class managing Napi::Buffer objects which use mmap(2)ed shared memory as external store which is based on provided example for Napi::ObjectWrap<T> found here; Here's the ...
Shahaboddin's user avatar
0 votes
0 answers
41 views

SSL context creation crashes of c++ native module in Electron application

I am building a C++ native module to be used in an Electron application. The native module is responsible for communicating with a WebSocket server. I am using the WebSocketPP library and the ...
Vasyl K's user avatar
  • 31
0 votes
1 answer
44 views

DB using node-adodb on an electron app : working fine in dev, but not on build

I have an issue with my on going app : I'm creating a desktop app using Electron-Forge, with React on Frontend and NodeJS on Backend. I need to use an Access DB as my DB, so I'm using node-adodb. Here'...
Paul Valy's user avatar
2 votes
0 answers
51 views

How do I return/emit *really* asynchronously from a C++ node-addon-api (or N-API) to Node?

The situation is as follows: my JavaScript shall start an external hardware process via a node-addon-api call into a C++ library. That hardware process runs for an indeterminate amount of time and is (...
Vroomfondel's user avatar
  • 2,887
2 votes
1 answer
98 views

How to properly handle Object/Buffer/Uint8Array in AsyncWorker?

I couldn't find in the documentation and examples how to properly handle Object/Buffer/Uint8Array parameters in AsyncWorker? The task: I'd like to receive data as Uint8Array and use it in AsyncWorker. ...
mahnunchik's user avatar
  • 1,165
0 votes
0 answers
20 views

Provide additional DLL Directory in node-module using bindings.gyp

We have an app with multiple node-module having dependency on the same DLL (C.DLL). Both of these node-modules needs the C.DLL to be present in their directory for successful loading. Our current ...
Divyank S's user avatar
0 votes
0 answers
108 views

C API mysql_real_connect throw Segmentation fault (core dumped) when it is build by node-gyp

Issue I could run the function dosomething() when it is compiled with g++ directly. But I could not run it when it is build with node-gyp. I was able to narrow my issue down to just a few files, I am ...
Jonah's user avatar
  • 81
0 votes
0 answers
267 views

Native Node Modules in Next.js Server Actions

When try to load a compiled native NODE-Addon I got this error: Module parse failed: Unexpected character '�' (1:0) You may need an appropriate loader to handle this file type, currently no loaders ...
eliasbauer's user avatar
0 votes
1 answer
84 views

How to include the same library in different linux distros with node-gyp

I'm trying to build my project on linux but I need to use two shared libraries (SDL2 and SDL2 image), the problem is that the path to the libraries depends on the distro. For example: on Ubuntu the ...
Simone Ancona's user avatar
2 votes
0 answers
31 views

Do NodeJS addons use the Heap?

After reading this post about the heap, I'm left wondering: do the operations performed in a Node addon context consume that same heap memory?
glimmbo's user avatar
  • 303
0 votes
1 answer
153 views

Why is Napi::ThreadSafeFunction with ObjectWrap blocking the event loop from exiting?

I've found that using ThreadSafeFunction in an ObjectWrap class blocks the event loop from exiting even after the program has finished. As soon as I remove the functions which use ThreadSafeFunction (...
Alex Shaw's user avatar
  • 223
0 votes
1 answer
616 views

Cannot import a .node addon module with require

I am developing a nodejs addon using node-addon-api and node-gyp 9.3.1. However, when I try to import using require it gives me the following error: Uncaught Error: The specified module could not be ...
Simone Ancona's user avatar
2 votes
0 answers
301 views

I can't connect to web socket server in electron app

I am working on electron project which includes node addon module. In native module, I am using ixWebSocket library to communicate with third party api. After initializing websocket properties, I call ...
Vasyl K's user avatar
  • 31
1 vote
0 answers
999 views

Node-gyp build fails. Unable to figure out what is causing the issue

Iam trying to install the jsonski package, but Iam encountering issues with node-gyp while doing so. I am able to run the node-gyp configure command without issues as seen below, ubuntu@Ubuntu-22:~/...
Alan Zink's user avatar

15 30 50 per page
1
2 3 4 5
9