Problems in compiling and using node FFI under electron

The project needed to load DLLS in NodeJS, learned that the easiest solution was to use Node-FFI, and then started a half-day of novice tramp.
This problem occurs when NPM install FFI sets up the project

error: no member named 'ForceSet' in 'v8::Object'

After checking on the official website, the author indicated that FFI does not support nodeJS 10 or above at present. Then I researched and walked through a lot of pothoods and found electronrebuild, which actually automatically goes down the corresponding Node header file and lib according to the electron version and platform version used in your project, and successfully solved the COMPILATION problem of FFI. After that, I tried to package and release, but there was another problem. Debugging code in Vscode was running well, and lifting directly with Electron. Exe would indicate that dynamic library loading failed


This DLL loading code, please use the absolute path, modify the dynamic scheme, done

Read More: