Error during install Modbus Node in raspberry pi4

Hi every one

I start to learn Node-red from short time

I install it in my computer and install all nodes I need and everything is ok

but when I tried to use it with Raspberry pi4, I face issue in install node (node-red-contrib-modbus) for modbus communication.

Here is the full log.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(** Start of log **)-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

2 Jul 20:36:11 - [info] Installing module: node-red-contrib-modbus, version: 5.1
3.3
2 Jul 20:36:48 - [warn] Installation of module node-red-contrib-modbus failed:
2 Jul 20:36:48 - [warn] ------------------------------------------
2 Jul 20:36:48 - [warn] prebuild-install WARN install No prebuilt binaries found
(target=10.21.0 runtime=node arch=arm libc= platform=linux)
make: *** No targets specified and no makefile found. Stop.
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_
modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess.handle.onexit (internal/child_proces
s.js:248:12)
gyp ERR! System Linux 4.19.118-v7l+
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/n
ode-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/.node-red/node_modules/@serialport/bindings
gyp ERR! node -v v10.21.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
make: *** No targets specified and no makefile found. Stop.
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node

modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess.handle.onexit (internal/child_proces
s.js:248:12)
gyp ERR! System Linux 4.19.118-v7l+
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/
node-gyp/bin/node-gyp.js" "configure" "build"
gyp ERR! cwd /home/pi/.node-red/node_modules/fs-ext
gyp ERR! node -v v10.21.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
prebuild-install WARN install No prebuilt binaries found (target=10.21.0 runtime
=node arch=arm libc= platform=linux)
make: *** No targets specified and no makefile found. Stop.
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node

modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces
s.js:248:12)
gyp ERR! System Linux 4.19.118-v7l+
gyp ERR! command "/usr/bin/node" "/usr/local/lib/node_modules/npm/node_modules/n
ode-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/.node-red/node_modules/modbus-serial/node_modules/@serialp
ort/bindings
gyp ERR! node -v v10.21.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN node-red-contrib-ui-led@0.3.1 requires a peer of node-red-dashboard@2.1
4.x but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @serialport/bindings@9.0.0 (node
_modules/@serialport/bindings):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @serialport/bindings@9.0.0 insta
ll: prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs-ext@0.5.0 (node_modules/fs-ex
t):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs-ext@0.5.0 install: node-gyp configure build
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@8.0.8 install: prebuild-install --tag-prefix @ser ialport/bindings@ || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@8.0.8 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! /home/pi/.npm/_logs/2020-07-02T19_36_48_162Z-debug.log
2 Jul 20:36:48 - [warn] ------------------------------------------

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(** End of log **)------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I also upgrade the full OS using (sudo apt full-upgrade)
Also ued this commad ( sudo apt-get install build-essential)

If any one face problem like this or any one can help me, I will be so grateful.

Thanks in advance.

I don't know what might cause this, but since no-one else has replied so far then possibly I can get things moving.
Firstly to get your system up to date you have run sudo apt update before sudo apt full-upgrade so try that first. Then in a terminal go to your .node-red folder and run
npm install node-red-contrib-modbus
if that still fails then how did you install node-red? The recommended way is using the script from https://nodered.org/docs/getting-started/raspberrypi

As the error seems to be related to serialport, maybe something on this thread will help resolve the issue: Why can't the serial palette be installed?

Thank you guys for your reply
First I upgraded the operating system and there were no any errors, but when I upgrade node red it gave me a lot of errors then i tried to install modbus node again but it didn't work

But your comment give me good idea to remove full node red and install it from beginning

(as I didn't install it first time at raspberry pi, but it installed with operation system)

So after remove full node-red and Node.js and install them from scratch and I tried again to install modbus node it finally work.

Thank you very much.

1 Like

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