I am getting into Electron to try to begin building desktop applications. I am running into this error:
/home/me/dev/my-electron-app-2/node_modules/electron/dist/electron exited with signal SIGTRAP
This path leads to a binary file, so I can't really read what is happening. This error comes when I run:
npm start
My goal is to have a window appear on my desktop reflecting the HTML page. So far, the app is just:
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
We are using Node.js <span id="node-version"></span>,
Chromium <span id="chrome-version"></span>,
and Electron <span id="electron-version"></span>.
</body>
</html>
main.js
const { app, BrowserWindow } = require('electron')
const createWindow = () => {
const win = new BrowserWindow({
width: 800,
height: 600
})
win.loadFile('index.html')
}
app.whenReady().then(() => {
createWindow()
})
This code has come from the docs, here: https://www.electronjs.org/docs/latest/tutorial/quick-start
I have googled quite a bit and have been unable to find a solution that sticks. I am using Ubuntu in WSL. If anyone has any advice it would be appreciated.
Thanks