Open HeyWatchOutDude opened 4 years ago
The answer is that there was a package dependency on node-hid@0.5.7 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!
I suggest to use mine, follow the steps on the readme: npm install robertsLando/node-red-contrib-usbhid
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
node-hid@1.3.0 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"
^
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! node-hid@1.3.0 install: prebuild-install || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-hid@1.3.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`
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/
Follow it word for word.
Follow steps here: https://github.com/robertsLando/node-red-contrib-usbhid
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.
@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.
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
node-hid@1.3.0 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! node-hid@1.3.0 install:prebuild-install || node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-hid@1.3.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`
Information:
The following worked for me:
"getHIDdevices" and "HIDdevice" is successful installed!
Hey,
did someone tried to install it on a RBP4? Because im unable to install it ...