Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

219
Visualizações
Electron not starting properly due to SIGTRAP

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

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Since electron is a GUI application, and you are using Ubuntu on WSL (I'm assuming WSL2?), you need to run an X server for Ubuntu have something to render the GUI on.

You can download and install VcXsrv from here: https://sourceforge.net/projects/vcxsrv/

How to configure it is explained in the top answer to this question: How to set up working X11 forwarding on WSL2

Your other option is to not use WSL; just run node, npm and electron directly on your Windows machine. Then, you will not need to install any separate X server; your app should just work.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda