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

556
Vistas
Why does electron fail to start?

I have just started working with electron recently, using a tutorial posted here. The github for the project template I created for myself to use based off of what I learned is here. The README of that repo shows all of the things I did when creating that template.

So far everything has been hunky dory, at least for the first couple times I run npm run dev after running npm install and npm run build. After maybe two or three successful attempts, when I return to the project later to try and run it, the concurrency plugin will load wait-on properly, but wait-on never seems to trigger when the react-scripts finishes successfully initiating the local server for the react page. Here is my output:

PS D:\Home\Projects\finally> npm run dev
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> finally@0.1.0 dev
> concurrently -k -s command-electron "cross-env BROWSER=none npm start" "npm:electron"

[electron] npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
[0] npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
[electron]
[electron] > finally@0.1.0 electron
[electron] > wait-on tcp:3000 && electron .
[electron]
[0]
[0] > finally@0.1.0 start
[0] > react-scripts start
[0]
[0] (node:4504) [DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning: 'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
[0] (Use `node --trace-deprecation ...` to show where the warning was created)
[0] (node:4504) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
[0] Starting the development server...
[0]
[0] Compiled successfully!
[0]
[0] You can now view finally in the browser.
[0]
[0]   Local:            http://localhost:3000
[0]   On Your Network:  http://172.28.224.1:3000
[0]
[0] Note that the development build is not optimized.
[0] To create a production build, use npm run build.
[0]
[0] webpack compiled successfully
[0] No issues found.

At this point it never continues, it just hangs, and the electron window never populates. I have tried recreating the repo a couple times, deleting build and node_modules and reinstalling, but nothing seems to be a common factor.

Also it should be noted, this is without having added any code beyond what that template provides. I clone the template, try to run it, it works a couple times, and then no more.

Any insights?

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

0

This could be caused by node.js update.

This fixes it

  1. Go to the node.js installation folder, eg. C:\Program Files\nodejs
  2. Open npm.cmd with notepad as admin
  3. Edit the file by replacing prefix -g with prefix --location=global, and Save
  4. Make the same change to npx.cmd too

Test if it is fixed

If it is not fixed, try updating npm using npm install npm@latest -g

enter image description here


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