I had the same problem, with the same library. There are full details of the debugging steps here: https://github.com/aza547/wow-recorder/issues/328.
In summary:
- Get the dependencies program (a modern dependency walker) and drop the .node file throwing the error in there to show what's not being found.
- Note that node.exe is a false positive for obs-studio-node (it's a delay dependency) - not really sure what that is, but I can launch fine without it. I suspect it's only loaded in dev mode or something like that.
- In my case (and probably yours as well) it was the Visual C++ Redistributable package from Microsoft, which is available here: https://aka.ms/vs/17/release/vc_redist.x64.exe
- That's a common dependency of electron apps I believe. Streamlabs desktop (also using the same obs-studio-node library) installs it as as part of streamlabs desktop https://github.com/stream-labs/desktop/blob/master/installer.nsh.
I think lots of other apps will install this too, I had several copies on my machine when I went looking. That explains why some people never hit this and others do.
Removing them all, I could reproduce the issue. Then in Warcraft Recorder (my program) I fixed this in the same manner, here:
https://github.com/aza547/wow-recorder/pull/379/files.
Effectively all that is doing is telling the NSIS installer to download that link and run it as part of the installation.
In package.json, add NSIS config and point it to a custom script:
"nsis": {
"oneClick": false,
"allowToChangeInstallationDirectory": true,
"include": "installer.nsh",
"deleteAppDataOnUninstall": true
},
The installer.nsh file:
!macro customInstall
NSISdl::download https://aka.ms/vs/17/release/vc_redist.x64.exe "$INSTDIR\vc_redist.x64.exe"
${If} ${FileExists} `$INSTDIR\vc_redist.x64.exe`
ExecWait '$INSTDIR\vc_redist.x64.exe /passive /norestart' $1
${If} $1 != '0'
${If} $1 != '3010'
MessageBox MB_OK|MB_ICONEXCLAMATION 'WARNING: Streamlabs was unable to install the latest Visual C++ Redistributable package from Microsoft.'
${EndIf}
${EndIf}
# ${If} $1 == '3010'
# MessageBox MB_OK|MB_ICONEXCLAMATION 'You must restart your computer to complete the installation.'
# ${EndIf}
${Else}
MessageBox MB_OK|MB_ICONEXCLAMATION 'WARNING: Streamlabs was unable to download the latest Visual C++ Redistributable package from Microsoft.'
${EndIf}
FileOpen $0 "$INSTDIR\installername" w
FileWrite $0 $EXEFILE
FileClose $0
!macroend