Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

"Error: cannot open device with path at new HID" on Electron build #439

Open
WilsonPhoo opened this issue Jan 10, 2020 · 8 comments
Open

Comments

@WilsonPhoo
Copy link

Hi,

I received this error while connecting to Nano Ledger S on a build version of my electron app.

getUSBConnection: Error: cannot open device with path at new HID (/Volumes/MyApp/MyApp.app/Contents/Resources/app.asar/node_modules/node-hid/nodehid.js:49) at Promise.resolve.then (TransportNodeHid.js:122) at <anonymous>

I am using these packages:

dependencies:
"@ledgerhq/hw-app-eth": "^5.3.0",
"@ledgerhq/hw-transport-node-hid": "^5.3.0",
"node-hid": "^1.1.0",
"usb": "^1.6.2"

devDependencies:
"electron-builder": "^21.2.0",

building on macOS Catalina v10.15.2

Any ideas why?

Thanks!

@obiyankenobi
Copy link

I also had this problem. It's actually related to the node-hid lib.

I managed to solve this following this: node-hid/node-hid#321

@gre
Copy link
Contributor

gre commented Mar 3, 2020

i'm not really sure if we have the same problem as discussed in node-hid/node-hid#321
but worth an internal discussion. cc @juan-cortes @MortalKastor

I know that this issue definitely happen if the usb connection has been acquired by another software / the device has been opened by another app like Ledger Live.

@juan-cortes
Copy link
Contributor

I get that when my vm handles my nano s and I try to access it from the host machine. So the host machine can see it but when it tries to lock access to it, it fails. 🤷‍♂ Don't know if it's related.

@gre
Copy link
Contributor

gre commented Mar 3, 2020

@juan-cortes yeah to me it's similar to what i mean by "some software have acquired the connection to the device". As soon as someone open() and do not close(), that error will happen on a second open() attempt.
but that does not prevent to list devices.

@WilsonPhoo
Copy link
Author

WilsonPhoo commented Mar 4, 2020

It used to work before, but stopped working after upgrading to macOS Catalina. Can it be OS related?

@gre
Copy link
Contributor

gre commented Mar 4, 2020

node-hid/node-hid#321 seems to refer to this. I'm on Catalina and don't have any issue on Ledger Live but maybe we configured something for this.

@hoonsubin
Copy link

hoonsubin commented Aug 4, 2020

is there a solution to this issue yet? Seeing the same error on macOS Catalina

@jacques-martin10
Copy link

Manual solution:

chgrp plugdev /dev/hidraw1
chmod 660 /dev/hidraw1

Automated solution via udev, see https://unix.stackexchange.com/a/85459

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

No branches or pull requests

6 participants