If you're using Windows Subsystem for Linux (WSL), there are some quirks to running Electron apps. Since you can run a mostly complete Linux distribution inside it, it justifiably declares itself as Linux when you're inside of it. However, as of February 2021 there is no support for running graphical apps compiled for Linux out of the box. Simply trying to run an Electron app in development that you've installed dependencies in WSL will try and fail to find an X11 server, and thus not launch.
Fortunately, one of the features of WSL is that you can run Windows executables from a WSL terminal seamlessly. The caveat is that you'll need to reinstall Electron in order to pick up the prebuilt binaries for Windows instead of Linux. Inside a WSL terminal, assuming that you've installed Node.js for Linux, you can run:
# If node_modules exists already that was installed in WSL:rm -r node_modules# then:npm install --platform=win32# or:npm_config_platform=win32 npm install
# If node_modules exists already that was installed in WSL:rm -r node_modules# then:npm_config_platform=win32 yarn
Then, start the Electron app in development mode as usual via
npm start or
yarn start (respectively).
For package/make/publish, you'll still need to specify the platform if you want to generate bundles/distributables for Windows.
npm run make -- --platform=win32
yarn make --platform=win32