According to typescript enter link description here:
Running tsc locally will compile the closest project defined by a tsconfig.json, or you can compile a set of TypeScript files by passing in a glob of files you want. When input files are specified on the command line, tsconfig.json files are ignored.
Making that your change to esModuleInterop
so, change your script from: "electron:watch": "tsc main.ts --outDir dist && nodemon --watch main.ts --exec \"electron .\"",
to something like: "electron:watch": "npx tsc && nodemon --watch ./server --exec \"electron .\"",