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

392
Vistas
Running node script with node command works fine, but not if I use it as basic JS file

I have a small script that captures the keyboard globally, for this I have been using node-global-key-listener. In a simple Node project the script works correctly but I need to use it from my ElectronJS (version "^16.0.7") and Vue3 application where, when accessing it, it returns the following error:

(node:1732) UnhandledPromiseRejectionWarning: Error: spawn D:\RepositoriosSlang\clienteslangGitHub\bin\WinKeyServer.exe ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)     
(Use `electron --trace-warnings ...` to show where the warning was created)    
(node:1732) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode).

The package use a .exe in Windows that it is not accessing correctly, that .exe is in the same node_module but it's being searched in the project root path.

Is there a difference between execute the script with node command and use it directly ?

about 4 years ago · Juan Pablo Isaza
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