# Cant Install "node-red-contrib-usbhid" node

**URL:** <https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685>\
**Category:** General\
**Created:** [10 March 2022 23:20 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685 "2022-03-10T23:20:15Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jts450](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jts450](https://discourse.nodered.org/u/jts450)\
**Post date:** [10 March 2022 23:20 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/1 "2022-03-10T23:20:16Z")

</div>

When installing the following node:

> **[node-red-contrib-usbhid](https://flows.nodered.org/node/node-red-contrib-usbhid)**
>
> A node-hid (USB HID device access library) wrapper for nodered

I an getting this error?  
C:\Users\Justst03\>npm install node-red-contrib-usbhid  
npm ERR! code 1  
npm ERR! path C:\Users\Justst03\node\_modules\node-hid  
npm ERR! command failed  
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild  
npm ERR! gyp info it worked if it ends with ok  
npm ERR! gyp info using node-gyp@8.2.0  
npm ERR! gyp info using node@17.0.1 | win32 | x64  
npm ERR! gyp ERR! find Python  
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration  
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON  
npm ERR! gyp ERR! find Python checking if "python3" can be used  
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error  
npm ERR! gyp ERR! find Python checking if "python" can be used  
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error  
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Justst03\AppData\Local\Programs\Python\Python39\python.exe  
npm ERR! gyp ERR! find Python - "C:\Users\Justst03\AppData\Local\Programs\Python\Python39\python.exe" could not be run  
npm ERR! gyp ERR! find Python checking if Python is C:\Program Files\Python39\python.exe  
npm ERR! gyp ERR! find Python - "C:\Program Files\Python39\python.exe" could not be run  
npm ERR! gyp ERR! find Python checking if Python is C:\Users\Justst03\AppData\Local\Programs\Python\Python39-32\python.exe  
npm ERR! gyp ERR! find Python - "C:\Users\Justst03\AppData\Local\Programs\Python\Python39-32\python.exe" could not b

---

<div class="post-metadata">

**Author:** ![mickym2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mickym2/32/36128_2.png) [@mickym2](https://discourse.nodered.org/u/mickym2)\
**Post date:** [11 March 2022 00:52 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/2 "2022-03-11T00:52:24Z")

</div>

I guess with over 5 years - this node is too old that it can be installed.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 March 2022 07:32 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/3 "2022-03-11T07:32:38Z")

</div>

No, its more likely the OP does not have the build tools installed.

@jts450

1. You tried to install at path `C:\Users\Justst03\` - I suspect this should be `C:\Users\Justst03\.node-red\`
2. node-red is not tested on NODE V17 - so i would uninstall that & install NODE V16 LTS or NODE V14 LTS
3. when you install NODE, there is a checkbox to install build tools - this must be checked if you are to install any nodes that have a compilation step  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/9/49fec4ce770e0769d6a82d165c7acac276931bc5.png)

---

<div class="post-metadata">

**Author:** ![jts450](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jts450](https://discourse.nodered.org/u/jts450)\
**Post date:** [11 March 2022 16:33 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/4 "2022-03-11T16:33:31Z")

</div>

Ahh.. ok, I need to see if Chocolatey will be approved by my IT team here at work. Do you know if I can go the the Chocolatey site and find the licensing agreement?

Alternatively ill see if I can install node-gyp

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 March 2022 16:35 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/5 "2022-03-11T16:35:37Z")

</div>

> [@jts450](#):
>
> Do you know if I can go the the Chocolatey site and find the licensing agreement?

[https://gprivate.com/5yk3e](https://gprivate.com/5yk3e) 🙂

---

<div class="post-metadata">

**Author:** ![jts450](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jts450](https://discourse.nodered.org/u/jts450)\
**Post date:** [11 March 2022 16:41 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/6 "2022-03-11T16:41:39Z")

</div>

> [@jts450](#):
>
> Chocolatey

ok 😁 Thank you

I cant even get to the Chocolatey site from my work machine.

I guess is there another way to get a usb barcode reader data into node-red? I believe the barcode reader I have acts just like a keyboard since when I have Excel open and read a barcode the data is written in the open excel file field

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [11 March 2022 16:53 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/7 "2022-03-11T16:53:12Z")

</div>

Many do work like a keyboard - others have a setting where you can make the barcode reader appear as a COM port device and send values over serial. This is much better (IMO) for integration as you dont need a text field focused to get barcode input.  
You will have to read the devices manual.

That said, the serial port will ALSO need to be compiled (to build tools will still need to be installed!)

---

<div class="post-metadata">

**Author:** ![jts450](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jts450](https://discourse.nodered.org/u/jts450)\
**Post date:** [11 March 2022 17:17 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/8 "2022-03-11T17:17:26Z")

</div>

Ok, I think I will have a hard time getting Chocolatey approved at work but so I might go with the other option of installing build tools manually.

to confirm on windows it looks like I need to install python and  
Visual C++ before I run ( npm install -g node-gyp) based on these instructions?

> **[GitHub - nodejs/node-gyp: Node.js native addon build tool](https://github.com/nodejs/node-gyp#on-windows)**
>
> Node.js native addon build tool. Contribute to nodejs/node-gyp development by creating an account on GitHub.

Thanks,

---

<div class="post-metadata">

**Author:** ![jts450](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jts450](https://discourse.nodered.org/u/jts450)\
**Post date:** [15 March 2022 13:42 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/9 "2022-03-15T13:42:27Z")

</div>

I tested installing Node.js V16 on another PC we have outside of IT network and let Chocolatey/power shell do its thing. It looked like it automatically downloaded Python and Visual studio and installed everything properly but it still had these errors when trying to install the usbhid node?

```auto
2022-03-14T22:26:00.691Z [err] npm ERR!
2022-03-14T22:26:00.691Z [err] gyp ERR! find VS **************************************************************
2022-03-14T22:26:00.691Z [err] npm ERR!
2022-03-14T22:26:00.692Z [err] gyp ERR! find VS 
2022-03-14T22:26:00.692Z [err] npm ERR! gyp ERR! configure error 
2022-03-14T22:26:00.692Z [err] npm ERR!
2022-03-14T22:26:00.692Z [err] gyp ERR! stack Error: Could not find any Visual Studio installation to use
2022-03-14T22:26:00.693Z [err] npm 
2022-03-14T22:26:00.693Z [err] ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
2022-03-14T22:26:00.693Z [err] npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
2022-03-14T22:26:00.693Z [err] npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:363:14)
2022-03-14T22:26:00.694Z [err] npm ERR!
2022-03-14T22:26:00.694Z [err] gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
2022-03-14T22:26:00.694Z [err] npm ERR!
2022-03-14T22:26:00.695Z [err] gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:384:16
2022-03-14T22:26:00.695Z [err] npm ERR!
2022-03-14T22:26:00.695Z [err] gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
2022-03-14T22:26:00.695Z [err] npm ERR!
2022-03-14T22:26:00.695Z [err] gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
2022-03-14T22:26:00.695Z [err] npm ERR!
2022-03-14T22:26:00.696Z [err] gyp ERR! stack at ChildProcess.exithandler (node:child_process:406:5)
2022-03-14T22:26:00.696Z [err] npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:520:28)
2022-03-14T22:26:00.696Z [err] npm 
2022-03-14T22:26:00.696Z [err] ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1092:16)
2022-03-14T22:26:00.696Z [err] npm ERR! gyp ERR! System Windows_NT 10.0.19044
2022-03-14T22:26:00.696Z [err] npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
2022-03-14T22:26:00.696Z [err] npm 
2022-03-14T22:26:00.696Z [err] ERR! gyp ERR! cwd C:\Users\Administrator\.node-red\node_modules\node-hid
2022-03-14T22:26:00.696Z [err] npm ERR!
2022-03-14T22:26:00.697Z [err] gyp ERR! node -v v16.14.0
2022-03-14T22:26:00.697Z [err] npm ERR! gyp ERR! node-gyp -v v8.4.1
2022-03-14T22:26:00.697Z [err] npm 
2022-03-14T22:26:00.697Z [err] ERR! gyp ERR! not ok
2022-03-14T22:26:00.704Z [err] 
2022-03-14T22:26:00.706Z [err] npm
2022-03-14T22:26:00.706Z [err]  
2022-03-14T22:26:00.708Z [err] ERR!
2022-03-14T22:26:00.710Z [err] A complete log of this run can be found in:
2022-03-14T22:26:00.710Z [err] npm ERR!
2022-03-14T22:26:00.711Z [err] C:\Users\Administrator\AppData\Local\npm-cache\_logs\2022-03-14T22_25_22_874Z-debug-0.log
2022-03-14T22:26:00.781Z rc=1

```

---

<div class="post-metadata">

**Author:** ![jts450](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jts450](https://discourse.nodered.org/u/jts450)\
**Post date:** [25 March 2022 15:15 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/10 "2022-03-25T15:15:52Z")

</div>

I still don't understand these errors and why I can install the HID node but looking at this

> **[GitHub - node-hid/node-hid: Access USB & Bluetooth HID devices through...](https://github.com/node-hid/node-hid)**
>
> Access USB & Bluetooth HID devices through Node.js - GitHub - node-hid/node-hid: Access USB & Bluetooth HID devices through Node.js

under general notes the HID node does not work with Barcode readers or keyboards?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/3/6346f7e00ab6301401d743b460a6af8ca38f78d5.png)

---

<div class="post-metadata">

**Author:** ![jts450](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jts450](https://discourse.nodered.org/u/jts450)\
**Post date:** [25 March 2022 15:18 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/11 "2022-03-25T15:18:24Z")

</div>

It also talks about how the operating system owns these devices and they cant be read using this node. If that is true I am wondering what people use this node for successfully?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 May 2022 15:18 UTC](https://discourse.nodered.org/t/cant-install-node-red-contrib-usbhid-node/59685/12 "2022-05-24T15:18:41Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
