In the main process, you can get the version from package.json with app.getVersion()
:
const { app } = require('electron');
const version = app.getVersion();
This may give you an unexpected result (the version of the Electron binary) when running your app in local development mode. (See GitHub issue #7085.)