Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

390
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!