Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error: spawn JlinkExe ENOENT" #3

Open
josejsarmento opened this issue May 10, 2022 · 1 comment
Open

"Error: spawn JlinkExe ENOENT" #3

josejsarmento opened this issue May 10, 2022 · 1 comment

Comments

@josejsarmento
Copy link

josejsarmento commented May 10, 2022

Working on a Raspberry Pi 4, Raspberry Pi OS lite 64, JLink V7.64e, npm 8.8.0
I have installed the NRFJprog terminal tools and JLinkExe for Linux Arm 64.

Using any of the instructions in the README, such as the following program.js:

var jlink = require("@connectedyard/node-jlink");      
jlink.reset(); // nrfjprog --reset

results in the following error:

> start
> node program.js

node:events:505
      throw er; // Unhandled 'error' event
      ^

Error: spawn JlinkExe ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn JlinkExe',
  path: 'JlinkExe',
  spawnargs: [
    '-device',
    'nrf51822',
    '-if',
    'swd',
    '-speed',
    '4000',
    '-autoconnect',
    '1'
  ]
}

Typing JLinkExe directly on the terminal opens the program, so it's correctly installed. Is this because the module is trying to call JlinkExe with a lowercase "L" instead of uppercase? I think this is done in line 43 of ./lib/jlinkexe.js

@stavrt
Copy link

stavrt commented Nov 18, 2023

Yup. I was testing this and seems like it wont work well. In the node_modules folder, you can edit jlinkexe.js

The code should be changed to this:

else if( process.platform.indexOf('linux') !== -1 ){ return "JLinkExe"; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants