@@ -239,11 +239,28 @@ Both of these cases are handled by the electron-webpack-quick-start example.
239
239
### node-gyp and native dependencies
240
240
241
241
Some node/electron versions are binary incompatible and require rebuilding of
242
- native node dependencies for electron. In offline mode, it may result in broken ABI.
243
- If you are seeing errors like
244
- ` The module 'something.node' was compiled against a different Node.js version ` ,
245
- then pass ` --electron-node-headers ` option to flatpak-node-generator and set
246
- ` npm_config_nodedir ` to ` flatpak-node/node-gyp/electron-current ` .
242
+ native node dependencies for electron. In offline mode, it may result in broken
243
+ ABI. If you are seeing errors like `The module 'something.node' was compiled
244
+ against a different Node.js version` , then pass ` --electron-node-headers`
245
+ option to flatpak-node-generator and set ` npm_config_nodedir ` to
246
+ ` flatpak-node/node-gyp/electron-current ` .
247
+
248
+ ** Note** : Setting ` npm_config_nodedir ` should not be necessary when using XDG-compliant
249
+ cache directories layout (the default, unless disabled via ` --no-xdg-layout ` ).
250
+
251
+ Some tools like * electron-rebuild* don't properly respect the
252
+ XDG spec however. In this case, as a workaround, you might need to symlink the
253
+ cache directory. For example:
254
+
255
+ ``` yaml
256
+ build-commands :
257
+ - |
258
+ ln -s $XDG_CACHE_HOME/node-gyp $HOME/.electron-gyp
259
+ npm run build
260
+ ` ` `
261
+
262
+ (Note that the build command must be ran as part of the same command as ` ln`,
263
+ i.e. it won't work if you run them as separate commands.)
247
264
248
265
# ## ffmpeg support
249
266
0 commit comments