Trouble with contrib-modbus module

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

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>

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:

The clue is there ^

You actually need windows build tools then try installing that node again

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

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

I attempted to install the Build Tools using:

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

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?

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.

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.

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

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

Same error, Cant not find Python Executable.

Put path to python27 in your environmental variables.

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>

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.

1 Like

Hi All,

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

from the log I get this infos:

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.

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.