# Trouble with contrib-modbus module

**URL:** https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653
**Category:** General
**Created:** [7 November 2019 21:09 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653 "2019-11-07T21:09:21Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![jfehl](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jfehl](https://discourse.nodered.org/u/jfehl)
#### Post date: [7 November 2019 21:09 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/1 "2019-11-07T21:09:21Z")

</div>

I am having trouble with contrib-modbus 4.1.3 communicating with a PLC. Version 3.6.1 works fine in a similar setup at a different location. Following the info I try ti install a later version but get the following error even logged in as administrator. Are there any suggestions on loading a previous version, or am I missing something else? v10.16.3 && 6.9.0

```auto
C:\Windows\system32>npm install -g node-red-contrib-modbus@3.6.1

> serialport@6.1.1 install C:\Users\P51QHMIPC00\AppData\Roaming\npm\node_modules
\node-red-contrib-modbus\node_modules\serialport
> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=10.16.3 runtime
=node arch=x64 platform=win32)

C:\Users\P51QHMIPC00\AppData\Roaming\npm\node_modules\node-red-contrib-modbus\no
de_modules\serialport>if not defined npm_config_node_gyp (node "C:\Program Files
\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_mod
ules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\no
de_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_mo
dules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_mod
ules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\grac
eful-fs\polyfills.js:282:31
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodej
s\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\P51QHMIPC00\AppData\Roaming\npm\node_modules\node-red-cont
rib-modbus\node_modules\serialport
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! serialport@6.1.1 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@6.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\P51QHMIPC00\AppData\Roaming\npm-cache\_logs\2019-11-07T20_
58_40_188Z-debug.log

C:\Windows\system32>

```

---

<div class="post-metadata">

### Author: ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)
#### Post date: [7 November 2019 21:40 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/2 "2019-11-07T21:40:30Z")

</div>

Seems like the `serialport` package is trying to build its native code, but it fails because your build environment isn't properly set up. Python is missing (required for node-gyp to work).

There is a setup guide for Windows on the node-gyp Github page:

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

---

<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: [7 November 2019 23:00 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/3 "2019-11-07T23:00:06Z")

</div>

> [@jfehl](#):
>
> Can't find Python executable

The clue is there ^

You actually need [windows build tools](https://www.npmjs.com/package/windows-build-tools) then try installing that node again

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [8 November 2019 07:18 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/4 "2019-11-08T07:18:58Z")

</div>

I don't use Windows, but should you be installing it globally?

---

<div class="post-metadata">

### Author: ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)
#### Post date: [8 November 2019 08:11 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/5 "2019-11-08T08:11:54Z")

</div>

That's a good point, too. You should install nodes locally into your Node-RED workspace (by default `.node-red` in your user profile).

---

<div class="post-metadata">

### Author: ![jfehl](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jfehl](https://discourse.nodered.org/u/jfehl)
#### Post date: [8 November 2019 14:10 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/6 "2019-11-08T14:10:07Z")

</div>

I attempted to install the Build Tools using:

```auto
npm install --global --production --add-python-to-path windows-build-tools

```

at CMD running as administrator. A result was given at the end that Python Installed Successfully, however after trying to run

```auto
npm install node-red-contrib-modbus@3.6.1

```

I recieved:

> Microsoft Windows [Version 6.1.7601]  
> Copyright (c) 2009 Microsoft Corporation. All rights reserved.
> 
> C:\Windows\system32\>npm install node-red-contrib-modbus@3.6.1
> 
> > serialport@6.1.1 install C:\Windows\system32\node\_modules\serialport  
> > prebuild-install || node-gyp rebuild
> 
> prebuild-install WARN install No prebuilt binaries found (target=10.16.3 runtime  
> =node arch=x64 platform=win32)
> 
> C:\Windows\system32\node\_modules\serialport\>if not defined npm\_config\_node\_gyp (  
> node "C:\Program Files\nodejs\node\_modules\npm\node\_modules\npm-lifecycle\node-g  
> yp-bin\....\node\_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\P  
> rogram Files\nodejs\node\_modules\npm\node\_modules\node-gyp\bin\node-gyp.js" rebu  
> ild )  
> gyp ERR! configure error  
> gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT  
> HON env variable.  
> gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node\_mo  
> dules\npm\node\_modules\node-gyp\lib\configure.js:484:19)  
> gyp ERR! stack at PythonFinder. (C:\Program Files\nodejs\node\_mod  
> ules\npm\node\_modules\node-gyp\lib\configure.js:509:16)  
> gyp ERR! stack at C:\Program Files\nodejs\node\_modules\npm\node\_modules\grac  
> eful-fs\polyfills.js:282:31  
> gyp ERR! stack at FSReqWrap.oncomplete (fs.js:153:21)  
> gyp ERR! System Windows\_NT 6.1.7601  
> gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodej  
> s\node\_modules\npm\node\_modules\node-gyp\bin\node-gyp.js" "rebuild"  
> gyp ERR! cwd C:\Windows\system32\node\_modules\serialport  
> gyp ERR! node -v v10.16.3  
> gyp ERR! node-gyp -v v3.8.0  
> gyp ERR! not ok  
> npm WARN enoent ENOENT: no such file or directory, open 'C:\Windows\system32\pac  
> kage.json'  
> npm WARN system32 No description  
> npm WARN system32 No repository field.  
> npm WARN system32 No README data  
> npm WARN system32 No license field.
> 
> npm ERR! code ELIFECYCLE  
> npm ERR! errno 1  
> npm ERR! serialport@6.1.1 install: `prebuild-install || node-gyp rebuild`  
> npm ERR! Exit status 1  
> npm ERR!  
> npm ERR! Failed at the serialport@6.1.1 install script.  
> npm ERR! This is probably not a problem with npm. There is likely additional log  
> ging output above.
> 
> npm ERR! A complete log of this run can be found in:  
> npm ERR! C:\Users\P51QHMIPC00\AppData\Roaming\npm-cache\_logs\2019-11-08T14\_  
> 00\_05\_634Z-debug.log
> 
> C:\Windows\system32\>

Did I install the build Tool incorrectly?

---

<div class="post-metadata">

### Author: ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)
#### Post date: [8 November 2019 15:42 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/7 "2019-11-08T15:42:32Z")

</div>

Did you reboot or logout after you installed the build tools? Maybe python isn't in your path yet.

Does it find python if you execute it in cmd shell?

I think there was also an option for your `.npmrc` to set the path to the python executable by executing:  
`npm config set python /path/to/executable/python`

That's what I did at work on my Windows PC. I can't check it right now as I only have Linux machines at home.

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [8 November 2019 16:29 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/8 "2019-11-08T16:29:46Z")

</div>

You are trying to install it from your Windows system folder, you have to do it from your node red folder, or use the node red palette manager in the editor.

---

<div class="post-metadata">

### Author: ![jfehl](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jfehl](https://discourse.nodered.org/u/jfehl)
#### Post date: [8 November 2019 16:46 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/9 "2019-11-08T16:46:22Z")

</div>

OK, Python apparently is installed, but maybe not in the correct place?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/77ae5c3691ce002f58e411e0dd253901da5d929b.png)

---

<div class="post-metadata">

### Author: ![jfehl](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jfehl](https://discourse.nodered.org/u/jfehl)
#### Post date: [8 November 2019 16:49 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/10 "2019-11-08T16:49:16Z")

</div>

> [@jfehl](#):
>
> npm install node-red-contrib-modbus@3.6.1

I will try to install from the Node-Red folder now. Thanks

---

<div class="post-metadata">

### Author: ![jfehl](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jfehl](https://discourse.nodered.org/u/jfehl)
#### Post date: [8 November 2019 16:50 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/11 "2019-11-08T16:50:14Z")

</div>

Same error, Cant not find Python Executable.

---

<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: [8 November 2019 17:14 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/12 "2019-11-08T17:14:42Z")

</div>

Put path to python27 in your environmental variables.

---

<div class="post-metadata">

### Author: ![jfehl](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jfehl](https://discourse.nodered.org/u/jfehl)
#### Post date: [8 November 2019 17:25 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/13 "2019-11-08T17:25:58Z")

</div>

OK, I added Python to the environment variables. I now have a new result, possibly on the right track?

Microsoft Windows [Version 6.1.7601]  
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\P51QHMIPC00.node-red\>npm install node-red-contrib-modbus@3.6.1

> serialport@6.1.1 install C:\Users\P51QHMIPC00.node-red\node\_modules\serialpor  
> t  
> prebuild-install || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=10.16.3 runtime  
=node arch=x64 platform=win32)

C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\>if not defined npm\_config  
\_node\_gyp (node "C:\Program Files\nodejs\node\_modules\npm\node\_modules\npm-lifec  
ycle\node-gyp-bin\....\node\_modules\node-gyp\bin\node-gyp.js" rebuild ) else  
(node "C:\Program Files\nodejs\node\_modules\npm\node\_modules\node-gyp\bin\node-g  
yp.js" rebuild )  
Building the projects in this solution one at a time. To enable parallel build,  
please add the "/m" switch.  
serialport.cpp  
serialport\_win.cpp  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(41):  
warning C4996: 'v8::String::Utf8Value::Utf8Value': was declared deprecated [C:  
Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-gyp\10.16.3\include\node\v8.h(2891): note: see dec  
laration of 'v8::String::Utf8Value::Utf8Value'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(48):  
warning C4996: 'v8::Value::ToObject': was declared deprecated [C:\Users\P51QHMI  
PC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-gyp\10.16.3\include\node\v8.h(10046): note: see de  
claration of 'v8::Value::ToObject'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(95):  
warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\P51QHMI  
PC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\nan\nan.h(1740): note: see declar  
ation of 'Nan::Callback::Call'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(113):  
warning C4996: 'v8::Value::ToObject': was declared deprecated [C:\Users\P51QHM  
IPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-gyp\10.16.3\include\node\v8.h(10046): note: see de  
claration of 'v8::Value::ToObject'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(150):  
warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\P51QHM  
IPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\nan\nan.h(1740): note: see declar  
ation of 'Nan::Callback::Call'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(188):  
warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\P51QHM  
IPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\nan\nan.h(1740): note: see declar  
ation of 'Nan::Callback::Call'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(231):  
warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\P51QHM  
IPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\nan\nan.h(1740): note: see declar  
ation of 'Nan::Callback::Call'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(250):  
warning C4996: 'v8::Value::ToObject': was declared deprecated [C:\Users\P51QHM  
IPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-gyp\10.16.3\include\node\v8.h(10046): note: see de  
claration of 'v8::Value::ToObject'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(285):  
warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\P51QHM  
IPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\nan\nan.h(1740): note: see declar  
ation of 'Nan::Callback::Call'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(336):  
warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\P51QHM  
IPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\nan\nan.h(1740): note: see declar  
ation of 'Nan::Callback::Call'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(383):  
warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\P51QHM  
IPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\nan\nan.h(1740): note: see declar  
ation of 'Nan::Callback::Call'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport.cpp(424):  
warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\P51QHM  
IPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\nan\nan.h(1740): note: see declar  
ation of 'Nan::Callback::Call'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(1  
83): warning C4311: 'type cast': pointer truncation from 'HANDLE' to 'int' [C:  
Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(1  
83): warning C4302: 'type cast': truncation from 'HANDLE' to 'int' [C:\Users\P5  
1QHMIPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(1  
93): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
00): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
10): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
12): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
16): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
18): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
22): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
24): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
29): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
41): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
51): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
68): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(2  
99): warning C4996: 'v8::Value::ToObject': was declared deprecated [C:\Users\P5  
1QHMIPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-gyp\10.16.3\include\node\v8.h(10046): note: see de  
claration of 'v8::Value::ToObject'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(3  
29): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(3  
55): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(3  
84): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\P5  
1QHMIPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\nan\nan.h(1740): note: see declar  
ation of 'Nan::Callback::Call'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(4  
01): warning C4996: 'v8::Value::ToObject': was declared deprecated [C:\Users\P5  
1QHMIPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-gyp\10.16.3\include\node\v8.h(10046): note: see de  
claration of 'v8::Value::ToObject'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(4  
56): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(4  
73): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(4  
86): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(4  
96): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(5  
24): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(5  
35): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(5  
67): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\P5  
1QHMIPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\nan\nan.h(1740): note: see declar  
ation of 'Nan::Callback::Call'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(5  
83): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(5  
85): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(7  
49): warning C4996: 'Nan::Callback::Call': was declared deprecated [C:\Users\P5  
1QHMIPC00.node-red\node\_modules\serialport\build\serialport.vcxproj]  
c:\users\p51qhmipc00.node-red\node\_modules\nan\nan.h(1740): note: see declar  
ation of 'Nan::Callback::Call'  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(7  
63): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
c:\users\p51qhmipc00.node-red\node\_modules\serialport\src\serialport\_win.cpp(7  
72): warning C4312: 'type cast': conversion from 'int' to 'HANDLE' of greater s  
ize [C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\build\serialport.vc  
xproj]  
win\_delay\_load\_hook.cc  
Creating library C:\Users\P51QHMIPC00.node-red\node\_modules\serialport\bu  
ild\Release\serialport.lib and object C:\Users\P51QHMIPC00.node-red\node\_mod  
ules\serialport\build\Release\serialport.exp  
Generating code  
All 467 functions were compiled because no usable IPDB/IOBJ from previous com  
pilation was found.  
Finished generating code  
serialport.vcxproj -\> C:\Users\P51QHMIPC00.node-red\node\_modules\serialport  
build\Release\serialport.node

- node-red-contrib-modbus@3.6.1  
added 145 packages from 58 contributors and audited 1668 packages in 69.601s  
found 39 vulnerabilities (12 low, 25 high, 2 critical)  
run `npm audit fix` to fix them, or `npm audit` for details

C:\Users\P51QHMIPC00.node-red\>

---

<div class="post-metadata">

### Author: ![jfehl](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jfehl](https://discourse.nodered.org/u/jfehl)
#### Post date: [8 November 2019 17:40 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/14 "2019-11-08T17:40:54Z")

</div>

Well after adding the environment variable path, I successfully have the 3.6.1 version of the

contrib-modbus, However, I am still having issues with it, I believe for the sake of this topic, the solution is found. Thanks for all the help.

---

<div class="post-metadata">

### Author: ![ilmisu](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ilmisu/32/27748_2.png) [@ilmisu](https://discourse.nodered.org/u/ilmisu)
#### Post date: [29 June 2020 10:14 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/15 "2020-06-29T10:14:38Z")

</div>

Hi All,

i pick Up this topic just for ask help for the same node installation.

from the log I get this infos:

```auto
2020-06-29T10:04:22.980Z Install : node-red-contrib-modbus 5.13.2

2020-06-29T10:04:29.980Z npm.cmd install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-modbus@5.13.2
2020-06-29T10:04:40.238Z [out] 
2020-06-29T10:04:40.238Z [out] > @serialport/bindings@9.0.0 install C:\Users\Administrator\.node-red\node_modules\@serialport\bindings
2020-06-29T10:04:40.238Z [out] > prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2020-06-29T10:04:40.238Z [out] 
2020-06-29T10:04:40.883Z [err] prebuild-install
2020-06-29T10:04:40.883Z [err] WARN install unable to get local issuer certificate
2020-06-29T10:04:40.898Z [out] 

2020-06-29T10:04:40.898Z [out] C:\Users\Administrator\.node-red\node_modules\@serialport\bindings>if not defined npm_config_node_gyp 
2020-06-29T10:04:40.898Z [out] (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 

2020-06-29T10:04:41.967Z [err] gyp
2020-06-29T10:04:41.967Z [err] WARN 
2020-06-29T10:04:41.967Z [err] install got an error, rolling back install
2020-06-29T10:04:41.972Z [err] gyp
2020-06-29T10:04:41.972Z [err] ERR! configure error 
2020-06-29T10:04:41.972Z [err] gyp ERR! 
2020-06-29T10:04:41.973Z [err] stack Error: unable to get local issuer certificate
2020-06-29T10:04:41.973Z [err] gyp ERR! 
2020-06-29T10:04:41.973Z [err] stack at TLSSocket.onConnectSecure (_tls_wrap.js:1047:34)
2020-06-29T10:04:41.973Z [err] gyp 
2020-06-29T10:04:41.973Z [err] ERR! stack
2020-06-29T10:04:41.973Z [err] at TLSSocket.emit (events.js:182:13)
2020-06-29T10:04:41.973Z [err] gyp ERR! 
2020-06-29T10:04:41.973Z [err] stack at TLSSocket._finishInit (_tls_wrap.js:629:8)
2020-06-29T10:04:41.973Z [err] gyp 
2020-06-29T10:04:41.973Z [err] ERR! System Windows_NT 10.0.14393
2020-06-29T10:04:41.973Z [err] gyp
2020-06-29T10:04:41.973Z [err] ERR! command
2020-06-29T10:04:41.973Z [err] "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
2020-06-29T10:04:41.973Z [err] gyp
2020-06-29T10:04:41.973Z [err] ERR! cwd
2020-06-29T10:04:41.974Z [err] C:\Users\Administrator\.node-red\node_modules\@serialport\bindings
2020-06-29T10:04:41.974Z [err] gyp 
2020-06-29T10:04:41.974Z [err] ERR! node -v v10.9.0
2020-06-29T10:04:41.974Z [err] gyp ERR!
2020-06-29T10:04:41.974Z [err] node-gyp -v v3.7.0
2020-06-29T10:04:41.974Z [err] gyp ERR! 
2020-06-29T10:04:41.974Z [err] not ok 
2020-06-29T10:04:42.038Z [out] 
2020-06-29T10:04:42.038Z [out] > @serialport/bindings@8.0.8 install C:\Users\Administrator\.node-red\node_modules\modbus-serial\node_modules\@serialport\bindings
2020-06-29T10:04:42.038Z [out] > prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2020-06-29T10:04:42.038Z [out] 
2020-06-29T10:04:42.643Z [err] prebuild-install
2020-06-29T10:04:42.643Z [err] WARN install
2020-06-29T10:04:42.643Z [err] unable to get local issuer certificate
2020-06-29T10:04:42.660Z [out] 

2020-06-29T10:04:42.660Z [out] C:\Users\Administrator\.node-red\node_modules\modbus-serial\node_modules\@serialport\bindings>if not defined npm_config_node_gyp 
2020-06-29T10:04:42.660Z [out] (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) 

2020-06-29T10:04:43.672Z [err] gyp
2020-06-29T10:04:43.673Z [err]  
2020-06-29T10:04:43.673Z [err] WARN install got an error, rolling back install
2020-06-29T10:04:43.678Z [err] gyp
2020-06-29T10:04:43.678Z [err] ERR! configure error 
2020-06-29T10:04:43.678Z [err] gyp ERR! stack Error: unable to get local issuer certificate
2020-06-29T10:04:43.678Z [err] gyp
2020-06-29T10:04:43.678Z [err] ERR! stack at TLSSocket.onConnectSecure (_tls_wrap.js:1047:34)
2020-06-29T10:04:43.678Z [err] gyp
2020-06-29T10:04:43.679Z [err] ERR! stack
2020-06-29T10:04:43.679Z [err] at TLSSocket.emit (events.js:182:13)
2020-06-29T10:04:43.679Z [err] gyp ERR! 
2020-06-29T10:04:43.679Z [err] stack at TLSSocket._finishInit (_tls_wrap.js:629:8)
2020-06-29T10:04:43.679Z [err] gyp
2020-06-29T10:04:43.679Z [err] ERR! System Windows_NT 10.0.14393
2020-06-29T10:04:43.679Z [err] gyp ERR!
2020-06-29T10:04:43.679Z [err] command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
2020-06-29T10:04:43.679Z [err] gyp ERR! cwd C:\Users\Administrator\.node-red\node_modules\modbus-serial\node_modules\@serialport\bindings
2020-06-29T10:04:43.679Z [err] gyp ERR! node -v
2020-06-29T10:04:43.679Z [err] v10.9.0
2020-06-29T10:04:43.679Z [err] gyp ERR! node-gyp -v v3.7.0
2020-06-29T10:04:43.679Z [err] gyp ERR!
2020-06-29T10:04:43.679Z [err] not ok 
2020-06-29T10:04:44.047Z [err] npm
2020-06-29T10:04:44.047Z [err] WARN ws@7.3.0 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
2020-06-29T10:04:44.047Z [err] npm WARN ws@7.3.0 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
2020-06-29T10:04:44.047Z [err] npm
2020-06-29T10:04:44.047Z [err] WARN optional
2020-06-29T10:04:44.048Z [err] SKIPPING OPTIONAL DEPENDENCY: @serialport/bindings@9.0.0 (node_modules\@serialport\bindings):
2020-06-29T10:04:44.048Z [err] npm WARN
2020-06-29T10:04:44.048Z [err] optional SKIPPING OPTIONAL DEPENDENCY: @serialport/bindings@9.0.0 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
2020-06-29T10:04:44.048Z [err] npm 
2020-06-29T10:04:44.048Z [err] WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
2020-06-29T10:04:44.048Z [err] 
2020-06-29T10:04:44.051Z [err] npm
2020-06-29T10:04:44.051Z [err] ERR! code ELIFECYCLE
2020-06-29T10:04:44.051Z [err] npm 
2020-06-29T10:04:44.051Z [err] ERR! errno 1
2020-06-29T10:04:44.051Z [err] npm ERR!
2020-06-29T10:04:44.051Z [err] @serialport/bindings@8.0.8 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
2020-06-29T10:04:44.051Z [err] npm ERR! Exit status 1
2020-06-29T10:04:44.051Z [err] npm
2020-06-29T10:04:44.051Z [err] ERR! 
2020-06-29T10:04:44.051Z [err] npm 
2020-06-29T10:04:44.051Z [err] ERR! Failed at the @serialport/bindings@8.0.8 install script.
2020-06-29T10:04:44.051Z [err] npm 
2020-06-29T10:04:44.051Z [err] ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-06-29T10:04:44.061Z [err] 
2020-06-29T10:04:44.061Z [err] npm ERR! A complete log of this run can be found in:
2020-06-29T10:04:44.061Z [err] npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-06-29T10_04_44_054Z-debug.log

```

could anybody (or @jfehl) help me "like a donkey" to solve this problem? thanks.

---

<div class="post-metadata">

### Author: ![jfehl](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jfehl](https://discourse.nodered.org/u/jfehl)
#### Post date: [1 July 2020 01:33 UTC](https://discourse.nodered.org/t/trouble-with-contrib-modbus-module/17653/16 "2020-07-01T01:33:23Z")

</div>

I wish I had more information to offer, but looking at my installation I am using modbus version 4.1.3 and I fear that is I were to go to 5.13.2 I would have the same issue you are. Can you load an older version? I am currently successfully reading my Modbus devices at this version.
