I am trying to make an npm initializer with electronjs. According to the npm documentation, to make an initializer, your script needs to be started with npx.
Electronjs scripts require that they be started with the electron
command and not the node
command. The problem is that npm init (npx) starts commands in node
. I saw that the electron-start
package somehow achieves this, but I don't understand how.
Whenever I try to const electron = require( 'electron' )
from the node
command in PowerShell (instead of electron), electron
returns a path string to the executable, and not an object containing the BrowserWindow
or app
properties.