Connecting OpenPLC to Node RED

Hello Guys, Im trying to connecting my OpenPLC on Raspi with Nodered. so i decided to install OpenPLC pallete on Node-red. I always aget this error when i try to install openplc for node-red (node-red-contrib-openplc) from CLI or GUI.

this is what they said

-----------------------------------------------------------
2021-04-05T06:27:36.195Z Install : node-red-contrib-openplc 1.0.1

2021-04-05T06:27:36.202Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-contrib-openplc@1.0.1
2021-04-05T06:27:37.836Z [err] npm
2021-04-05T06:27:37.836Z [err]  WARN deprecated request@2.88.2: request has been deprecated, see #https://github.com/request/request/issues/3142
2021-04-05T06:27:38.234Z [err] npm
2021-04-05T06:27:38.234Z [err]  WARN deprecated node-modbus@3.2.6: please, use modbus-serial (has tcp and serial) or jsmodbus - contact me to get the package access
2021-04-05T06:27:39.943Z [err] npm
2021-04-05T06:27:39.943Z [err]  WARN deprecated har-validator@5.1.5: this library is no longer supported
2021-04-05T06:27:42.570Z [out] 
2021-04-05T06:27:42.570Z [out] > serialport@4.0.7 install /root/snap/node-red/675/node_modules/serialport
2021-04-05T06:27:42.570Z [out] > node-pre-gyp install --fallback-to-build
2021-04-05T06:27:42.570Z [out] 
2021-04-05T06:27:42.749Z [err] node-pre-gyp
2021-04-05T06:27:42.752Z [err]  
2021-04-05T06:27:42.752Z [err] info it worked if it ends with ok
2021-04-05T06:27:42.755Z [err] node-pre-gyp 
2021-04-05T06:27:42.755Z [err] verb cli [ '/snap/node-red/675/bin/node',
2021-04-05T06:27:42.755Z [err] node-pre-gyp verb cli   '/root/snap/node-red/675/node_modules/serialport/node_modules/.bin/node-pre-gyp',
2021-04-05T06:27:42.755Z [err] node-pre-gyp
2021-04-05T06:27:42.755Z [err]  verb cli   'install',
2021-04-05T06:27:42.755Z [err] node-pre-gyp verb 
2021-04-05T06:27:42.755Z [err] cli   '--fallback-to-build' ]
2021-04-05T06:27:42.755Z [err] node-pre-gyp
2021-04-05T06:27:42.755Z [err]  info 
2021-04-05T06:27:42.756Z [err] using node-pre-gyp@0.6.32
2021-04-05T06:27:42.756Z [err] node-pre-gyp
2021-04-05T06:27:42.756Z [err]  info
2021-04-05T06:27:42.756Z [err]  using node@10.23.3 | linux | x64
2021-04-05T06:27:42.756Z [err] node-pre-gyp 
2021-04-05T06:27:42.756Z [err] verb command install []
2021-04-05T06:27:42.798Z [err] node-pre-gyp 
2021-04-05T06:27:42.798Z [err] info check checked for "/root/snap/node-red/675/node_modules/serialport/build/Release/serialport.node" (not found)
2021-04-05T06:27:42.798Z [err] node-pre-gyp
2021-04-05T06:27:42.798Z [err]  http 
2021-04-05T06:27:42.798Z [err] GET
2021-04-05T06:27:42.798Z [err]  #https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-linux-x64.tar.gz
2021-04-05T06:27:49.197Z [err] node-pre-gyp
2021-04-05T06:27:49.197Z [err]  http 404 https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-linux-x64.tar.gz
2021-04-05T06:27:49.197Z [err] node-pre-gyp
2021-04-05T06:27:49.198Z [err]  ERR! 
2021-04-05T06:27:49.198Z [err] Tried to download(404): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-linux-x64.tar.gz 
2021-04-05T06:27:49.198Z [err] node-pre-gyp 
2021-04-05T06:27:49.198Z [err] ERR! 
2021-04-05T06:27:49.198Z [err] Pre-built binaries not found for serialport@4.0.7 and node@10.23.3 (node-v64 ABI) (falling back to source compile with node-gyp) 
2021-04-05T06:27:49.198Z [err] node-pre-gyp
2021-04-05T06:27:49.198Z [err]  http 
2021-04-05T06:27:49.198Z [err] 404 status code downloading tarball #https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-linux-x64.tar.gz 
2021-04-05T06:27:49.199Z [err] node-pre-gyp
2021-04-05T06:27:49.199Z [err]  verb command build [ 'rebuild' ]
2021-04-05T06:27:49.217Z [err] node-pre-gyp
2021-04-05T06:27:49.217Z [err]  ERR! Tried to download(undefined): #https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v64-linux-x64.tar.gz 
2021-04-05T06:27:49.217Z [err] node-pre-gyp 
2021-04-05T06:27:49.217Z [err] ERR! 
2021-04-05T06:27:49.217Z [err] Pre-built binaries not found for serialport@4.0.7 and node@10.23.3 (node-v64 ABI) (falling back to source compile with node-gyp) 
2021-04-05T06:27:49.217Z [err] node-pre-gyp http
2021-04-05T06:27:49.217Z [err]  Connection closed while downloading tarball file
2021-04-05T06:27:49.217Z [err]  
2021-04-05T06:27:49.217Z [err] node-pre-gyp
2021-04-05T06:27:49.217Z [err]  verb command build [ 'rebuild' ]
2021-04-05T06:27:51.491Z [err] gyp ERR! build error 
2021-04-05T06:27:51.491Z [err] gyp ERR! stack Error: not found: make
2021-04-05T06:27:51.491Z [err] gyp ERR! stack     at getNotFoundError (/snap/node-red/675/lib/node_modules/npm/node_modules/which/which.js:13:12)
2021-04-05T06:27:51.491Z [err] gyp ERR! stack     at F (/snap/node-red/675/lib/node_modules/npm/node_modules/which/which.js:68:19)
2021-04-05T06:27:51.491Z [err] gyp ERR! stack     at E (/snap/node-red/675/lib/node_modules/npm/node_modules/which/which.js:80:29)
2021-04-05T06:27:51.491Z [err] gyp ERR! stack     at /snap/node-red/675/lib/node_modules/npm/node_modules/which/which.js:89:16
2021-04-05T06:27:51.491Z [err] gyp ERR! stack     at /snap/node-red/675/lib/node_modules/npm/node_modules/isexe/index.js:42:5
2021-04-05T06:27:51.491Z [err] gyp ERR! stack     at /snap/node-red/675/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
2021-04-05T06:27:51.491Z [err] gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:153:21)
2021-04-05T06:27:51.491Z [err] gyp ERR! System Linux 5.8.0-48-generic
2021-04-05T06:27:51.492Z [err] gyp 
2021-04-05T06:27:51.492Z [err] ERR! command
2021-04-05T06:27:51.492Z [err]  "/snap/node-red/675/bin/node" "/snap/node-red/675/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/root/snap/node-red/675/node_modules/serialport/build/Release/serialport.node" "--module_name=serialport" "--module_path=/root/snap/node-red/675/node_modules/serialport/build/Release"
2021-04-05T06:27:51.493Z [err] gyp ERR! cwd /root/snap/node-red/675/node_modules/serialport
2021-04-05T06:27:51.493Z [err] gyp ERR! node -v v10.23.3
2021-04-05T06:27:51.493Z [err] gyp ERR! node-gyp -v v5.1.0
2021-04-05T06:27:51.493Z [err] gyp ERR! not ok 
2021-04-05T06:27:51.500Z [err] node-pre-gyp
2021-04-05T06:27:51.500Z [err]  ERR! build error
2021-04-05T06:27:51.500Z [err]  
2021-04-05T06:27:51.501Z [err] node-pre-gyp
2021-04-05T06:27:51.501Z [err]  ERR! 
2021-04-05T06:27:51.501Z [err] stack
2021-04-05T06:27:51.501Z [err]  Error: Failed to execute '/snap/node-red/675/bin/node /snap/node-red/675/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/root/snap/node-red/675/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/root/snap/node-red/675/node_modules/serialport/build/Release' (1)
2021-04-05T06:27:51.501Z [err] node-pre-gyp
2021-04-05T06:27:51.502Z [err]  ERR! stack     at ChildProcess.<anonymous> (/root/snap/node-red/675/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
2021-04-05T06:27:51.502Z [err] node-pre-gyp ERR!
2021-04-05T06:27:51.502Z [err]  
2021-04-05T06:27:51.502Z [err] stack
2021-04-05T06:27:51.502Z [err]      at ChildProcess.emit (events.js:198:13)
2021-04-05T06:27:51.502Z [err] node-pre-gyp ERR!
2021-04-05T06:27:51.502Z [err]  stack
2021-04-05T06:27:51.502Z [err]      at maybeClose (internal/child_process.js:982:16)
2021-04-05T06:27:51.502Z [err] node-pre-gyp
2021-04-05T06:27:51.502Z [err]  
2021-04-05T06:27:51.502Z [err] ERR!
2021-04-05T06:27:51.502Z [err]  
2021-04-05T06:27:51.502Z [err] stack
2021-04-05T06:27:51.502Z [err]      at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
2021-04-05T06:27:51.504Z [err] node-pre-gyp
2021-04-05T06:27:51.505Z [err]  
2021-04-05T06:27:51.505Z [err] ERR!
2021-04-05T06:27:51.505Z [err]  System
2021-04-05T06:27:51.505Z [err]  Linux 5.8.0-48-generic
2021-04-05T06:27:51.505Z [err] node-pre-gyp
2021-04-05T06:27:51.505Z [err]  
2021-04-05T06:27:51.505Z [err] ERR!
2021-04-05T06:27:51.505Z [err]  
2021-04-05T06:27:51.505Z [err] command
2021-04-05T06:27:51.505Z [err]  "/snap/node-red/675/bin/node" "/root/snap/node-red/675/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
2021-04-05T06:27:51.506Z [err] node-pre-gyp
2021-04-05T06:27:51.506Z [err]  
2021-04-05T06:27:51.506Z [err] ERR!
2021-04-05T06:27:51.506Z [err]  
2021-04-05T06:27:51.506Z [err] cwd
2021-04-05T06:27:51.506Z [err]  /root/snap/node-red/675/node_modules/serialport
2021-04-05T06:27:51.506Z [err] node-pre-gyp
2021-04-05T06:27:51.506Z [err]  
2021-04-05T06:27:51.506Z [err] ERR!
2021-04-05T06:27:51.506Z [err]  
2021-04-05T06:27:51.506Z [err] node -v
2021-04-05T06:27:51.506Z [err]  v10.23.3
2021-04-05T06:27:51.506Z [err] node-pre-gyp
2021-04-05T06:27:51.506Z [err]  
2021-04-05T06:27:51.506Z [err] ERR! 
2021-04-05T06:27:51.506Z [err] node-pre-gyp -v v0.6.32
2021-04-05T06:27:51.506Z [err] node-pre-gyp
2021-04-05T06:27:51.507Z [err]  
2021-04-05T06:27:51.507Z [err] ERR!
2021-04-05T06:27:51.507Z [err]  not ok
2021-04-05T06:27:51.507Z [err]  
2021-04-05T06:27:51.508Z [out] Failed to execute '/snap/node-red/675/bin/node /snap/node-red/675/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/root/snap/node-red/675/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/root/snap/node-red/675/node_modules/serialport/build/Release' (1)
2021-04-05T06:27:51.662Z [err] gyp
2021-04-05T06:27:51.665Z [err]  
2021-04-05T06:27:51.665Z [err] ERR! build error
2021-04-05T06:27:51.665Z [err]  
2021-04-05T06:27:51.666Z [err] gyp
2021-04-05T06:27:51.666Z [err]  ERR! stack Error: not found: make
2021-04-05T06:27:51.666Z [err] gyp ERR!
2021-04-05T06:27:51.666Z [err]  stack     at getNotFoundError (/snap/node-red/675/lib/node_modules/npm/node_modules/which/which.js:13:12)
2021-04-05T06:27:51.666Z [err] gyp 
2021-04-05T06:27:51.666Z [err] ERR! 
2021-04-05T06:27:51.666Z [err] stack
2021-04-05T06:27:51.666Z [err]      at F (/snap/node-red/675/lib/node_modules/npm/node_modules/which/which.js:68:19)
2021-04-05T06:27:51.666Z [err] gyp
2021-04-05T06:27:51.666Z [err]  ERR!
2021-04-05T06:27:51.666Z [err]  stack     at E (/snap/node-red/675/lib/node_modules/npm/node_modules/which/which.js:80:29)
2021-04-05T06:27:51.666Z [err] gyp ERR! 
2021-04-05T06:27:51.666Z [err] stack     at /snap/node-red/675/lib/node_modules/npm/node_modules/which/which.js:89:16
2021-04-05T06:27:51.666Z [err] gyp
2021-04-05T06:27:51.666Z [err]  ERR!
2021-04-05T06:27:51.666Z [err]  stack
2021-04-05T06:27:51.666Z [err]      at /snap/node-red/675/lib/node_modules/npm/node_modules/isexe/index.js:42:5
2021-04-05T06:27:51.666Z [err] gyp
2021-04-05T06:27:51.666Z [err]  
2021-04-05T06:27:51.666Z [err] ERR! 
2021-04-05T06:27:51.666Z [err] stack     at /snap/node-red/675/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
2021-04-05T06:27:51.666Z [err] gyp 
2021-04-05T06:27:51.667Z [err] ERR!
2021-04-05T06:27:51.667Z [err]  stack
2021-04-05T06:27:51.667Z [err]      at FSReqWrap.oncomplete (fs.js:153:21)
2021-04-05T06:27:51.667Z [err] gyp
2021-04-05T06:27:51.667Z [err]  ERR!
2021-04-05T06:27:51.667Z [err]  
2021-04-05T06:27:51.667Z [err] System
2021-04-05T06:27:51.667Z [err]  Linux 5.8.0-48-generic
2021-04-05T06:27:51.667Z [err] gyp
2021-04-05T06:27:51.667Z [err]  ERR!
2021-04-05T06:27:51.667Z [err]  
2021-04-05T06:27:51.668Z [err] command
2021-04-05T06:27:51.668Z [err]  "/snap/node-red/675/bin/node" "/snap/node-red/675/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/root/snap/node-red/675/node_modules/serialport/build/Release/serialport.node" "--module_name=serialport" "--module_path=/root/snap/node-red/675/node_modules/serialport/build/Release"
2021-04-05T06:27:51.668Z [err] gyp
2021-04-05T06:27:51.668Z [err]  
2021-04-05T06:27:51.668Z [err] ERR! 
2021-04-05T06:27:51.668Z [err] cwd
2021-04-05T06:27:51.668Z [err]  /root/snap/node-red/675/node_modules/serialport
2021-04-05T06:27:51.668Z [err] gyp
2021-04-05T06:27:51.668Z [err]  ERR!
2021-04-05T06:27:51.668Z [err]  node -v
2021-04-05T06:27:51.668Z [err]  v10.23.3
2021-04-05T06:27:51.668Z [err] gyp
2021-04-05T06:27:51.668Z [err]  
2021-04-05T06:27:51.668Z [err] ERR!
2021-04-05T06:27:51.668Z [err]  
2021-04-05T06:27:51.668Z [err] node-gyp -v
2021-04-05T06:27:51.668Z [err]  v5.1.0
2021-04-05T06:27:51.668Z [err] gyp
2021-04-05T06:27:51.668Z [err]  
2021-04-05T06:27:51.668Z [err] ERR!
2021-04-05T06:27:51.668Z [err]  not ok
2021-04-05T06:27:51.668Z [err]  
2021-04-05T06:27:52.248Z [err] npm WARN
2021-04-05T06:27:52.248Z [err]  notsup Unsupported engine for node-red-contrib-modbus@1.3.0: wanted: {"node":"6.x"} (current: {"node":"10.23.3","npm":"6.14.11"})
2021-04-05T06:27:52.248Z [err] npm WARN 
2021-04-05T06:27:52.248Z [err] notsup Not compatible with your version of node/npm: node-red-contrib-modbus@1.3.0
2021-04-05T06:27:52.249Z [err] 
2021-04-05T06:27:52.414Z [err] npm 
2021-04-05T06:27:52.415Z [err] ERR! code ELIFECYCLE
2021-04-05T06:27:52.415Z [err] npm
2021-04-05T06:27:52.415Z [err]  ERR! errno 1
2021-04-05T06:27:52.418Z [err] npm
2021-04-05T06:27:52.418Z [err]  ERR! serialport@4.0.7 install: `node-pre-gyp install --fallback-to-build`
2021-04-05T06:27:52.418Z [err] npm ERR!
2021-04-05T06:27:52.418Z [err]  Exit status 1
2021-04-05T06:27:52.418Z [err] npm
2021-04-05T06:27:52.418Z [err]  ERR!
2021-04-05T06:27:52.418Z [err]  
2021-04-05T06:27:52.418Z [err] npm 
2021-04-05T06:27:52.418Z [err] ERR!
2021-04-05T06:27:52.418Z [err]  Failed at the serialport@4.0.7 install script.
2021-04-05T06:27:52.418Z [err] npm 
2021-04-05T06:27:52.418Z [err] ERR!
2021-04-05T06:27:52.418Z [err]  This is probably not a problem with npm. There is likely additional logging output above.
2021-04-05T06:27:52.526Z [err] 
2021-04-05T06:27:52.526Z [err] npm ERR! A complete log of this run can be found in:
2021-04-05T06:27:52.526Z [err] npm ERR!
2021-04-05T06:27:52.526Z [err]      /root/snap/node-red/675/.npm/_logs/2021-04-05T06_27_52_448Z-debug.log
2021-04-05T06:27:52.568Z rc=1

can someone help me to fix this problem or give me an advice or maybe you have another method to connecting OpenPLC with Node RED without openplc pallete. thanks
npm -v
6.14.4
nodejs -v
v10.19.0

That is the clue, probably you have not installed the required build tools.
sudo apt install build-essential

I think you are right however did you notice the "snap" part?...

I dont know enough but I beleive snap installs are like VMs or docker-like isolated environments. Might be an issue.

@zeldakun must this be a SNAP install? Can you change to a regular install?

The snap install is indeed strictly contained so it won't have access to other tools etc.

It is also slightly behind on versions as the actual snapd needs some updates to handle newer versions of nodejs - so you need edge version of snapd as well as edge version of nodered snap if you want latest... but yeah it is still tightly inside a container so buildtools won't be there - as indeed the README says.

1 Like

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