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

RBP4 unable to install the modul #9

Open
HeyWatchOutDude opened this issue Feb 27, 2020 · 8 comments
Open

RBP4 unable to install the modul #9

HeyWatchOutDude opened this issue Feb 27, 2020 · 8 comments

Comments

@HeyWatchOutDude
Copy link

Hey,

did someone tried to install it on a RBP4?
Because im unable to install it ...

@kjngineering
Copy link

The answer is that there was a package dependency on [email protected] which will not compile on any recent version of node.js. This was updated in the git in 2019, but not the npm repository.
The new dependency node-hid@^0.7.7 compiled fine on V12.16.2 as of today.

The old npm version can be worked around (although) not recommended by either of the following commands:

if you have git installed:
npm install somebuddy87/node-red-contrib-usbhid

or if you do not have git installed:
npm install --save -g https://github.com/somebuddy87/node-red-contrib-usbhid/tarball/master

ideally the npm repository should be updated.

good luck!

@robertsLando
Copy link

I suggest to use mine, follow the steps on the readme: npm install robertsLando/node-red-contrib-usbhid

@thebaldgeek
Copy link

Trying either of these two packages results in the same error.
My system;
node -v
v10.16.3
npm -v
6.9.0

Is there anyway to install this package?

Here is the error;

` npm install robertsLando/node-red-contrib-usbhid

[email protected] install /home/dev/.node-red/node_modules/node-hid
prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=10.16.3 runtime=node arch=arm libc= platform=linux)
make: Entering directory '/home/dev/.node-red/node_modules/node-hid/build'
CC(target) Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o
In file included from ../hidapi/linux/hid.c:44:0:
/usr/include/libudev.h:21:2: error: #error "#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE is needed to use this experimental library version"
#error "#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE is needed to use this experimental library version"
^
hidapi-linux-hidraw.target.mk:99: recipe for target 'Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o' failed
make: *** [Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o] Error 1
make: Leaving directory '/home/dev/.node-red/node_modules/node-hid/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.1.15-rt18-nxtio-2.1.0+gfab9c55
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dev/.node-red/node_modules/node-hid
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: prebuild-install || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`

@nksky
Copy link

nksky commented Aug 21, 2020

I had awful trouble installing this aswell. But I got this to work..... on a Pi4
https://www.reddit.com/r/nodered/comments/f9ut7u/usb_hid_module/fiweao5/

image

Follow it word for word.

@robertsLando
Copy link

Follow steps here: https://github.com/robertsLando/node-red-contrib-usbhid

@thebaldgeek
Copy link

Thanks all for reaching out.

@nksky following those instructions (word for word) results in the error '../hidapi/linux/hid.c:44:21: fatal error: libudev.h: No such file or directory' when 'sudo apt install libudev-dev' results in 'libudev0 is already the newest version (182-r9).'
So no progress there.

@robertsLando there are no instructions on how to install the node on that page. Just instructions on how to use/configure the read/write access for non-root users.

@nksky
Copy link

nksky commented Aug 28, 2020

@thebaldgeek Let me try it again on a fresh install on the Pi. I was trying so long that I may have installed something before running this script and that made it work. Give me a day on it.

@HeyWatchOutDude
Copy link
Author

HeyWatchOutDude commented Mar 20, 2021

Trying either of these two packages results in the same error.
My system;
node -v
v10.16.3
npm -v
6.9.0

Is there anyway to install this package?

Here is the error;

` npm install robertsLando/node-red-contrib-usbhid

[email protected] install /home/dev/.node-red/node_modules/node-hid
prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=10.16.3 runtime=node arch=arm libc= platform=linux)
make: Entering directory '/home/dev/.node-red/node_modules/node-hid/build'
CC(target) Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o
In file included from ../hidapi/linux/hid.c:44:0:
/usr/include/libudev.h:21:2: error: #error "#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE is needed to use this experimental library version"
#error "#define LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE is needed to use this experimental library version"
^
hidapi-linux-hidraw.target.mk:99: recipe for target 'Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o' failed
make: *** [Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o] Error 1
make: Leaving directory '/home/dev/.node-red/node_modules/node-hid/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.1.15-rt18-nxtio-2.1.0+gfab9c55
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/dev/.node-red/node_modules/node-hid
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: prebuild-install || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`

Information:

  • npm version: 6.14.11
  • node version: 12.21.0
  • node-red version: 1.2.9

The following worked for me:

  • sudo apt install libudev-dev
  • sudo apt install libudev-1.0-0-dev
  • cd .node-red/
  • npm install somebuddy87/node-red-contrib-usbhid
  • sudo systemctl restart nodered

"getHIDdevices" and "HIDdevice" is successful installed!

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

5 participants