You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-1Lines changed: 25 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,9 @@ A copy of the source for SQLCipher 4.4.0 is bundled, which is based on SQLite 3.
55
55
56
56
## Building from source.
57
57
58
-
This is done automatically by node-pre-gyp when installing on a platform without pre-built binaries.
58
+
This is done automatically by node-pre-gyp when installing on a platform without pre-built binaries. This should generally
59
+
not be required with later versions, since two pre-built versions (N-API 3 and N-API 6) cover all electron and node versions.
60
+
59
61
However, this does require some additional setup, and is likely to run against obscure errors when installing.
60
62
61
63
Requirements:
@@ -69,6 +71,28 @@ Requirements:
69
71
* Visual Studio 2015
70
72
* Python 2.7
71
73
74
+
## Usage with electron-forge / electron-rebuild
75
+
76
+
[electron-forge](https://www.electronforge.io/) uses [electron-rebuild](https://github.com/electron/electron-rebuild) and attempts to rebuild this library from source by default, in a way
77
+
that is _not_ compatible with the way `node-pre-gyp` is used here.
78
+
79
+
The workaround is to disable the rebuilding:
80
+
1. If using Electron 11+, use a node version that supports N-API 6+ (v10.20.0+ / v12.17.0+ / v14.0.0).
81
+
2. After `npm install` / `yarn install`, make sure that the folder `node_modules/@journeyapps/sqlcipher/lib/binding/napi-v6-linux-x64` exists.
82
+
If not, check the previous step again, remove the `node_modules` folder, and try again.
83
+
3. Disable rebuilding of this library using the `onlyModules` option of `electron-rebuild` in your `package.json`:
84
+
85
+
"config": {
86
+
"forge": {
87
+
"electronRebuildConfig": {
88
+
"onlyModules": [] // Specify other native modules here if required
89
+
}
90
+
}
91
+
}
92
+
93
+
Note: [electron-builder](https://www.electron.build/) does not appear to have this issue, and should work directly.
94
+
Similarly, using electron directly should just work, but do check that a compatible node version is used (see above).
95
+
72
96
## OpenSSL
73
97
74
98
SQLCipher depends on OpenSSL. When using NodeJS, OpenSSL is provided by NodeJS itself. For Electron, we need to use our own copy.
0 commit comments