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

555
Visualizações
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 Respostas
Responde à pergunta

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 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