Tuesday, January 24, 2023

Blackmagic Workflow Integration using JavaScript/Electron - Node Modules


While building an electron application for Blackmagic Workflow Integration, I found that installing modules would present some errors specifically related to the Node-API version. 

For example, after installing sqlite3 the project would say can't find module: napi-v3-win32-unknown-x64\node_sqlite3.node

Looking at node_modules/ I noticed that the sqlite3 node build contained napi-v6-win32-unknown-x64\node_sqlite3.node


After a bit, it dawned on me that DaVinci Resolve was using it's own nodejs which would likely not be the version I have installed on my terminal. Launching the integration from Resolve with dev tools open, I quickly checked the version of node running: process.version and found that in my instance it was v12.13.0. Using NVM, I changed my terminal installed nodejs to be the same version and installed the node module once again. This produced the correct result.

Another way to find out the version of everything is to find and launch the electron application bundled with Resolve (Windows: C:\Program Files\Blackmagic Design\DaVinci Resolve\Electron) which will show you an application screen with information like this: 

No comments: