Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

143
Vistas
Electron app not spawning child process when moved to different folder

When a button is clicked in my app, a child process is spawned using the fork() function. This works as intended, even when bundled into an exe in my dist folder (via electron-builder). However, when I move the folder win-unpacked to another folder for testing, the child process is not spawned.

The dist folder structure is as shown:

dist
|-.icon-ico
|- win-unpacked
|- builder-debug.yaml
|- builder-effective-config.yaml

The win-unpacked is where all the main files are (such as app.asar, app.exe and such).

When it is in my main development folder such as this:

app
|-build
|-node_modules
|-dist
|-public
|-src

The child process is spawned, however, in the testing folder which just contains dist, the child process is not spawned.

To spawn the child process I have used:

child = fork(require("path").join(__dirname, "sts/states.js"));

In console, the __dirname is logged as C:\Users\me\Documents\mainApp\dist\win-unpacked\resources\app.asar\build.

the sts folder is located in build folder.

I do not actually know what the reason is to why this is not working when I take dist out of my app folder and place it into another folder for testing.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

With some help from this answer, I managed to get some direction. I added:

"build": {
    "extraResources": "node_modules",
    "files": [
      "!node_modules"
    ]
}

to my package.json and now it is spawning the child process. The downside is that the file is now larger (1.45GB).

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda