-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
I'm opening this issue to describe two approaches for using oracledb
v2.2 in an electron app:
-
Using electron-rebuild
The key for this approach to work is to:
- ensure that
nan
v2.8+ is listed amongst the dev dependencies (otherwise,electron-rebuild
will fail withnan
-related errors) - and run
electron-rebuild
at the postinstall step.
I've created the repo oracledb-electron-rebuild with a working example.
- ensure that
-
Using electron-builder
The key for this approach to work is to:
- use the source package from github:
npm install --save https://github.com/oracle/node-oracledb/releases/download/v2.2.0/oracledb-src-2.2.0.tgz
- and run
electron-builder install-app-deps
at the postinstall step.
See the repo oracledb-electron-builder for a working example.
- use the source package from github:
The reason for using the source package from github (instead of the package distributed via npm
) is that, unlike the package from github, the npm package runs node package/oracledbinstall.js
at the install step.
The purpose of oracledbinstall.js
is to download prebuilt binaries built against node. Unfortunately, this script is unaware of the npm environment variables used for building electron apps and prevents node-gyp rebuild
from running when building oracledb
against electron.
A suggestion: prebuild (a tool for creating prebuilt binaries) and prebuilt-install (for installing them) are both aware of electron.