Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatpak-node-generator README: Mention XDG path of electron node headers #260

Merged
merged 1 commit into from
Jun 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,28 @@ Both of these cases are handled by the electron-webpack-quick-start example.
### node-gyp and native dependencies

Some node/electron versions are binary incompatible and require rebuilding of
native node dependencies for electron. In offline mode, it may result in broken ABI.
If you are seeing errors like
`The module 'something.node' was compiled against a different Node.js version`,
then pass `--electron-node-headers` option to flatpak-node-generator and set
`npm_config_nodedir` to `flatpak-node/node-gyp/electron-current`.
native node dependencies for electron. In offline mode, it may result in broken
ABI. If you are seeing errors like `The module 'something.node' was compiled
against a different Node.js version`, then pass `--electron-node-headers`
option to flatpak-node-generator and set `npm_config_nodedir` to
`flatpak-node/node-gyp/electron-current`.

**Note**: Setting `npm_config_nodedir` should not be necessary when using XDG-compliant
cache directories layout (the default, unless disabled via `--no-xdg-layout`).

Some tools like *electron-rebuild* don't properly respect the
XDG spec however. In this case, as a workaround, you might need to symlink the
cache directory. For example:

```yaml
build-commands:
- |
ln -s $XDG_CACHE_HOME/node-gyp $HOME/.electron-gyp
npm run build
```

(Note that the build command must be ran as part of the same command as `ln`,
i.e. it won't work if you run them as separate commands.)

### ffmpeg support

Expand Down