electron: App Starts and Stops Immediately Without Launching Window or Error
Issue Details
- Electron Version: 7.1.4, 7.1.7
- Operating System: Windows 10 Home 1903, 1909
- Last Known Working Electron version: Can’t remember.
- Node Version: 12.8.1, 12.13.0, 12.14.0
- NPM Version: 6.13.4
- More info can be found here.
Expected Behavior
I expect the app and its corresponding window to launch…
Actual Behavior
No window is launched. No errors are thrown in Command Prompt. The app supposedly starts and then ends immediately. A screenshot of Command Prompt can be seen here or at the bottom of this post.
To Reproduce
- mkdir test
- cd test
- npm init
- enter, enter, enter…
- create index.js
const { app, BrowserWindow } = require('electron')
function createWindow () {
// Create the browser window.
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true
}
})
// and load the index.html of the app.
win.loadFile('index.html')
}
app.on('ready', createWindow)
- npm install electron --save-dev
- edit package.json to add the start script
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "electron .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"electron": "^7.1.4"
}
}
- create index.html
<!doctype html>
<html>
<head></head>
<body>
blahblahblah
</body>
</html>
- npm start
App starts and ends immediately and basically nothing happens.
Screenshots

Additional Information
All of my projects that were working fine the last time I worked on them about a month ago suddenly stopped working, which is how I discovered this issue. But even new projects are not working…
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 23
Locate the respective button at the page bottom.
Ok, having to delete that directory each time gets annoying. I went in and deleted files in their one-by-one until I found the offending file. It’s in the extensions directory. For me, it’s to do with the Vue.js dev tools extension. I know that your example project doesn’t use Vue.js, but do any of your other projects use it? If so, that could be the issue (so, not actually an Electron issue). Check the extensions folder and a file called “IDMap.json”. If it lists “Vue.js devtools”, then there’s your problem. Otherwise, I have no idea what’s causing it. This seems to be the issue I’m having: https://github.com/SimulatedGREG/electron-vue/issues/958
I was, but managed to fix it by removing the %appdata%\electron directory. It may be a caching issue.
I’ve had this problem too, on two different Windows 10 machines. Both were running 1903, and it’s after I moved from Electron 4 to Electron 7. Running electron.exe directly from node_modules\electron\dist doesn’t work either.
Edit: it even happens on a fresh project that started with Electron 7.
I have, no described issue noticed. I’d suggest trying https://github.com/electron/electron-quick-start first using 7.1.4 and then if it still doesn’t work with other electron versions so it’s clear that at least some electron versions work for you.