Can't install node-red-contrib-smartmeter

I’m stuck trying to install node-red-contrib-smartmeter. Seems some prerequisites are missing:

-----------------------------------------------------------
2022-12-12T20:12:33.623Z Installieren : node-red-contrib-smartmeter 0.6.3

2022-12-12T20:12:33.698Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2022-12-12T20:12:35.771Z [err] npm
2022-12-12T20:12:35.773Z [err]  WARN 
2022-12-12T20:12:35.773Z [err] config production Use `--omit=dev` instead.
2022-12-12T20:12:59.908Z [err] npm
2022-12-12T20:12:59.908Z [err]  ERR! code 1
2022-12-12T20:12:59.909Z [err] npm ERR!
2022-12-12T20:12:59.909Z [err]  path /config/node-red/node_modules/@serialport/bindings
2022-12-12T20:12:59.917Z [err] npm ERR! command failed
2022-12-12T20:12:59.917Z [err] npm ERR! command sh -c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2022-12-12T20:12:59.918Z [err] npm ERR! make: Entering directory '/config/node-red/node_modules/@serialport/bindings/build'
2022-12-12T20:12:59.918Z [err] npm ERR!   CXX(target) Release/obj.target/bindings/src/serialport.o
2022-12-12T20:12:59.918Z [err] npm ERR! make: Leaving directory '/config/node-red/node_modules/@serialport/bindings/build'
2022-12-12T20:12:59.918Z [err] npm ERR!
2022-12-12T20:12:59.918Z [err]  prebuild-install warn install No prebuilt binaries found (target=18.12.1 runtime=node arch=arm64 libc=musl platform=linux)
2022-12-12T20:12:59.918Z [err] npm ERR! gyp info it worked if it ends with ok
2022-12-12T20:12:59.918Z [err] npm ERR! gyp info using [email protected]
2022-12-12T20:12:59.918Z [err] npm ERR! gyp info using [email protected] | linux | arm64
2022-12-12T20:12:59.918Z [err] npm ERR!
2022-12-12T20:12:59.919Z [err]  gyp info find Python using Python version 3.10.9 found at "/usr/bin/python3"
2022-12-12T20:12:59.919Z [err] npm ERR! gyp http GET https://nodejs.org/download/release/v18.12.1/node-v18.12.1-headers.tar.gz
2022-12-12T20:12:59.919Z [err] npm ERR! gyp http 200 https://nodejs.org/download/release/v18.12.1/node-v18.12.1-headers.tar.gz
2022-12-12T20:12:59.919Z [err] npm ERR! gyp http GET https://nodejs.org/download/release/v18.12.1/SHASUMS256.txt
2022-12-12T20:12:59.919Z [err] npm ERR! gyp http 200 https://nodejs.org/download/release/v18.12.1/SHASUMS256.txt
2022-12-12T20:12:59.919Z [err] npm
2022-12-12T20:12:59.920Z [err]  ERR! gyp info spawn /usr/bin/python3
2022-12-12T20:12:59.920Z [err] npm ERR! gyp info spawn args [
2022-12-12T20:12:59.920Z [err] npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
2022-12-12T20:12:59.920Z [err] npm ERR! gyp info spawn args   'binding.gyp',
2022-12-12T20:12:59.920Z [err] npm ERR! gyp info spawn args   '-f',
2022-12-12T20:12:59.920Z [err] npm ERR! gyp info spawn args   'make',
2022-12-12T20:12:59.920Z [err] npm ERR! gyp info spawn args   '-I',
2022-12-12T20:12:59.920Z [err] npm ERR!
2022-12-12T20:12:59.920Z [err]  gyp info spawn args   '/config/node-red/node_modules/@serialport/bindings/build/config.gypi',
2022-12-12T20:12:59.920Z [err] npm ERR! gyp info spawn args   '-I',
2022-12-12T20:12:59.920Z [err] npm ERR! gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
2022-12-12T20:12:59.920Z [err] npm ERR! gyp info spawn args   '-I',
2022-12-12T20:12:59.920Z [err] npm ERR! gyp info spawn args   '/root/.cache/node-gyp/18.12.1/include/node/common.gypi',
2022-12-12T20:12:59.920Z [err] npm 
2022-12-12T20:12:59.921Z [err] ERR! gyp info spawn args   '-Dlibrary=shared_library',
2022-12-12T20:12:59.921Z [err] npm ERR! gyp info spawn args   '-Dvisibility=default',
2022-12-12T20:12:59.921Z [err] npm ERR! gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/18.12.1',
2022-12-12T20:12:59.921Z [err] npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
2022-12-12T20:12:59.921Z [err] npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/18.12.1/<(target_arch)/node.lib',
2022-12-12T20:12:59.921Z [err] npm ERR!
2022-12-12T20:12:59.921Z [err]  gyp info spawn args   '-Dmodule_root_dir=/config/node-red/node_modules/@serialport/bindings',
2022-12-12T20:12:59.921Z [err] npm ERR! gyp info spawn args   '-Dnode_engine=v8',
2022-12-12T20:12:59.921Z [err] npm ERR! gyp info spawn args   '--depth=.',
2022-12-12T20:12:59.921Z [err] npm ERR! gyp info spawn args   '--no-parallel',
2022-12-12T20:12:59.921Z [err] npm ERR! gyp info spawn args   '--generator-output',
2022-12-12T20:12:59.921Z [err] npm
2022-12-12T20:12:59.922Z [err]  ERR! gyp info spawn args   'build',
2022-12-12T20:12:59.922Z [err] npm ERR! gyp info spawn args   '-Goutput_dir=.'
2022-12-12T20:12:59.922Z [err] npm ERR! gyp info spawn args ]
2022-12-12T20:12:59.922Z [err] npm ERR! gyp info spawn make
2022-12-12T20:12:59.922Z [err] npm 
2022-12-12T20:12:59.923Z [err] ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
2022-12-12T20:12:59.923Z [err] npm ERR! make: g++: No such file or directory
2022-12-12T20:12:59.923Z [err] npm ERR! make: *** [bindings.target.mk:110: Release/obj.target/bindings/src/serialport.o] Error 127
2022-12-12T20:12:59.923Z [err] npm ERR! gyp ERR! build error 
2022-12-12T20:12:59.923Z [err] npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
2022-12-12T20:12:59.923Z [err] npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
2022-12-12T20:12:59.923Z [err] npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
2022-12-12T20:12:59.923Z [err] npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
2022-12-12T20:12:59.923Z [err] npm ERR! gyp ERR! System Linux 5.15.61-v8
2022-12-12T20:12:59.923Z [err] npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2022-12-12T20:12:59.923Z [err] npm ERR! gyp ERR! cwd /config/node-red/node_modules/@serialport/bindings
2022-12-12T20:12:59.923Z [err] npm ERR! gyp ERR! node -v v18.12.1
2022-12-12T20:12:59.924Z [err] npm ERR! gyp ERR! node-gyp -v v9.3.0
2022-12-12T20:12:59.924Z [err] npm ERR! gyp ERR! not ok
2022-12-12T20:12:59.934Z [err] 
2022-12-12T20:12:59.935Z [err] npm ERR! A complete log of this run can be found in:
2022-12-12T20:12:59.935Z [err] npm ERR!     /root/.npm/_logs/2022-12-12T20_12_35_615Z-debug-0.log
2022-12-12T20:12:59.988Z rc=1

My add-on config looks like this:

npm_packages: []
system_packages:
  - python3
  - npm
  - make

Does anybody have a hint? What am I missing? Thanks!

looks like you’re missing g++ add it your system packages if that doesn’t work try build-essential

As g++ didn’t do the trick I tried build-essential, but it’s producing an error in the logs:

ERROR: unable to select packages:
  build-essential (no such package):
    required by: world[build-essential]
[07:52:49] FATAL: Failed installing system package build-essential

This is how I did it:

npm_packages: []
system_packages:
  - python3
  - npm
  - make
  - g++
  - build-essential

All was working until I launched a massive update of the system after almost a year (core, supervisor, HA, node-red …).

Smartmeter is not available any more, it looks like I have similar issues. Did you solve yours?

 Add-on version: 14.0.1
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.4  (amd64 / qemux86-64)
 Home Assistant Core: 2022.12.8
 Home Assistant Supervisor: 2022.12.1
.
.
.
3 Jan 12:55:48 - [info] Node-RED version: v3.0.2
3 Jan 12:55:48 - [info] Node.js  version: v18.12.1
3 Jan 12:55:48 - [info] Linux 5.15.80 x64 LE
3 Jan 12:55:50 - [info] Loading palette nodes
3 Jan 12:55:59 - [info] Dashboard version 3.3.0 started at /endpoint/ui
3 Jan 12:56:01 - [warn] ------------------------------------------------------
3 Jan 12:56:01 - [warn] [node-red-contrib-smartmeter/smartmeter] Error: Error relocating /config/node-red/node_modules/@serialport/bindings/build/Release/bindings.node: _ZN2v82V818GlobalizeReferenceEPNS_8internal7IsolateEPm: symbol not found
3 Jan 12:56:01 - [warn] [node-red-contrib-smartmeter/smartmeter-connection] Error: Error relocating /config/node-red/node_modules/@serialport/bindings/build/Release/bindings.node: _ZN2v82V818GlobalizeReferenceEPNS_8internal7IsolateEPm: symbol not found

node-RED itself is telling me:

Flows stopped due to missing node types.
smartmeter-connection
smartmeter

This node is a type unknown to your installation of Node-RED.

In “Manage palette” I could even update the smart-meter contribution to 0.6.3 (before it was 0.6.0),

but in the palette it is gone.

I managed to get the node installed after a few google searches. Here is my Node Red Addon config:

npm_packages:

  • nan
  • serialport
  • node-red-contrib-smartmeter

system_packages:

  • python3
  • make
  • gcc
  • g++
  • linux-headers

There were all dependencies for the smartmeter node.

2 Likes

Thanks, that did the job.

I had already the same system_packages installed. Under npm_packages, I tried node-red-contrib-smartmeter too (which should have added the node type to the pallete by default), so I think the key to the solution was serialport.

Too much try and error in my eyes, but hey, now it works :sunglasses:.

Hi,

I also need help installing the smartmeter package in NodeRed. The installation keeps crashing with an error and I don’t know how to solve it.
Here is the log for it:

-----------------------------------------------------------
2023-01-04T15:17:07.022Z Installieren : node-red-contrib-smartmeter 0.6.3

2023-01-04T15:16:57.428Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2023-01-04T15:16:59.554Z [err] npm
2023-01-04T15:16:59.555Z [err]  WARN 
2023-01-04T15:16:59.556Z [err] config production Use `--omit=dev` instead.
2023-01-04T15:17:15.228Z [err] npm
2023-01-04T15:17:15.229Z [err]  WARN deprecated [email protected]: this library is no longer supported
2023-01-04T15:17:15.649Z [err] npm WARN
2023-01-04T15:17:15.650Z [err]  deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
2023-01-04T15:17:15.842Z [err] npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
2023-01-04T15:17:18.746Z [err] npm ERR! code 1
2023-01-04T15:17:18.746Z [err] npm ERR! path /config/node-red/node_modules/@serialport/bindings
2023-01-04T15:17:18.746Z [err] npm ERR! command failed
2023-01-04T15:17:18.746Z [err] npm ERR! command sh -c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2023-01-04T15:17:18.746Z [err] npm ERR! prebuild-install warn install No prebuilt binaries found (target=18.12.1 runtime=node arch=arm64 libc=musl platform=linux)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp info it worked if it ends with ok
2023-01-04T15:17:18.746Z [err] npm ERR! gyp info using [email protected]
2023-01-04T15:17:18.746Z [err] npm ERR! gyp info using [email protected] | linux | arm64
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python 
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python checking Python explicitly set from command line or npm configuration
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - "--python=" or "npm config get python" is "/usr/bin/python3"
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - "/usr/bin/python3" is not in PATH or produced an error
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python checking if "python3" can be used
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python checking if "python" can be used
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python 
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python **********************************************************
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python You need to install the latest version of Python.
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python you can try one of the following options:
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python For more information consult the documentation at:
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python **********************************************************
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! find Python 
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! configure error 
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack     at PythonFinder.fail (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack     at exithandler (node:child_process:420:5)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:432:5)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! System Linux 5.15.76-v8
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! cwd /config/node-red/node_modules/@serialport/bindings
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! node -v v18.12.1
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! node-gyp -v v9.3.0
2023-01-04T15:17:18.746Z [err] npm ERR! gyp ERR! not ok
2023-01-04T15:17:18.746Z [err] 
2023-01-04T15:17:18.746Z [err] npm ERR! A complete log of this run can be found in:
2023-01-04T15:17:18.746Z [err] npm ERR!     /root/.npm/_logs/2023-01-04T15_16_59_398Z-debug-0.log
2023-01-04T15:17:18.785Z rc=1

-----------------------------------------------------------
2023-01-04T15:19:15.713Z Installieren : node-red-contrib-smartmeter 0.6.3

2023-01-04T15:19:06.417Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2023-01-04T15:19:08.547Z [err] npm
2023-01-04T15:19:08.549Z [err]  WARN 
2023-01-04T15:19:08.549Z [err] config production Use `--omit=dev` instead.
2023-01-04T15:19:15.414Z [err] npm
2023-01-04T15:19:15.415Z [err]  WARN deprecated [email protected]: this library is no longer supported
2023-01-04T15:19:15.640Z [err] npm
2023-01-04T15:19:15.640Z [err]  WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
2023-01-04T15:19:15.716Z [err] npm 
2023-01-04T15:19:15.717Z [err] WARN
2023-01-04T15:19:15.717Z [err]  
2023-01-04T15:19:15.718Z [err] deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
2023-01-04T15:19:17.984Z [err] npm ERR!
2023-01-04T15:19:17.985Z [err]  code 1
2023-01-04T15:19:17.985Z [err] npm ERR! path /config/node-red/node_modules/@serialport/bindings
2023-01-04T15:19:17.990Z [err] npm ERR!
2023-01-04T15:19:17.991Z [err]  command failed
2023-01-04T15:19:17.991Z [err] npm ERR! command sh -c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2023-01-04T15:19:17.991Z [err] npm ERR!
2023-01-04T15:19:17.992Z [err]  prebuild-install warn install No prebuilt binaries found (target=18.12.1 runtime=node arch=arm64 libc=musl platform=linux)
2023-01-04T15:19:17.993Z [err] npm ERR! gyp info it worked if it ends with ok
2023-01-04T15:19:17.993Z [err] npm ERR! gyp info using [email protected]
2023-01-04T15:19:17.993Z [err] npm ERR! gyp info using [email protected] | linux | arm64
2023-01-04T15:19:17.993Z [err] npm ERR!
2023-01-04T15:19:17.993Z [err]  gyp ERR! find Python 
2023-01-04T15:19:17.993Z [err] npm ERR! gyp ERR! find Python checking Python explicitly set from command line or npm configuration
2023-01-04T15:19:17.993Z [err] npm ERR! gyp ERR! find Python - "--python=" or "npm config get python" is "/usr/bin/python3"
2023-01-04T15:19:17.993Z [err] npm ERR! gyp ERR! find Python - "/usr/bin/python3" is not in PATH or produced an error
2023-01-04T15:19:17.993Z [err] npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
2023-01-04T15:19:17.993Z [err] npm 
2023-01-04T15:19:17.994Z [err] ERR! gyp ERR! find Python checking if "python3" can be used
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python checking if "python" can be used
2023-01-04T15:19:17.994Z [err] npm
2023-01-04T15:19:17.994Z [err]  ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python 
2023-01-04T15:19:17.994Z [err] npm ERR!
2023-01-04T15:19:17.994Z [err]  gyp ERR! find Python **********************************************************
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python You need to install the latest version of Python.
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
2023-01-04T15:19:17.994Z [err] npm ERR! gyp ERR! find Python you can try one of the following options:
2023-01-04T15:19:17.994Z [err] npm 
2023-01-04T15:19:18.005Z [err] ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
2023-01-04T15:19:18.005Z [err] npm
2023-01-04T15:19:18.005Z [err]  ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
2023-01-04T15:19:18.005Z [err] npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
2023-01-04T15:19:18.005Z [err] npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
2023-01-04T15:19:18.005Z [err] npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
2023-01-04T15:19:18.005Z [err] npm
2023-01-04T15:19:18.005Z [err]  ERR! gyp ERR! find Python For more information consult the documentation at:
2023-01-04T15:19:18.005Z [err] npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
2023-01-04T15:19:18.005Z [err] npm ERR! gyp ERR! find Python **********************************************************
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! find Python 
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! configure error 
2023-01-04T15:19:18.006Z [err] npm
2023-01-04T15:19:18.006Z [err]  ERR! gyp ERR! stack Error: Could not find any Python installation to use
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! stack     at PythonFinder.fail (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
2023-01-04T15:19:18.006Z [err] npm
2023-01-04T15:19:18.006Z [err]  ERR! gyp ERR! stack     at PythonFinder.runChecks (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
2023-01-04T15:19:18.006Z [err] npm
2023-01-04T15:19:18.006Z [err]  ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! stack     at exithandler (node:child_process:420:5)
2023-01-04T15:19:18.006Z [err] npm
2023-01-04T15:19:18.006Z [err]  ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:432:5)
2023-01-04T15:19:18.006Z [err] npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
2023-01-04T15:19:18.006Z [err] npm
2023-01-04T15:19:18.007Z [err]  ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
2023-01-04T15:19:18.007Z [err] npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
2023-01-04T15:19:18.007Z [err] npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
2023-01-04T15:19:18.007Z [err] npm ERR!
2023-01-04T15:19:18.007Z [err]  gyp ERR! System Linux 5.15.76-v8
2023-01-04T15:19:18.007Z [err] npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2023-01-04T15:19:18.007Z [err] npm ERR!
2023-01-04T15:19:18.007Z [err]  gyp ERR! cwd /config/node-red/node_modules/@serialport/bindings
2023-01-04T15:19:18.007Z [err] npm ERR! gyp ERR! node -v v18.12.1
2023-01-04T15:19:18.007Z [err] npm ERR!
2023-01-04T15:19:18.007Z [err]  gyp ERR! node-gyp -v v9.3.0
2023-01-04T15:19:18.007Z [err] npm ERR! gyp ERR! not ok
2023-01-04T15:19:18.016Z [err] 
2023-01-04T15:19:18.017Z [err] npm ERR! A complete log of this run can be found in:
2023-01-04T15:19:18.018Z [err] npm ERR!     /root/.npm/_logs/2023-01-04T15_19_08_401Z-debug-0.log
2023-01-04T15:19:18.063Z rc=1

Thanks for your Help.

I was asking for a friend and he confirmed that it works now. Thanks @smarthome356!

@parkkralle you need to install the dependencies mentioned above via your Node-RED add-on configuration. In my opinion the easiest way is to switch to yaml-view (the three dots in the upper right corner) and insert these lines:

npm_packages:
  - nan
  - serialport
  - node-red-contrib-smartmeter
system_packages:
  - python3
  - make
  - gcc
  - g++
  - linux-headers
3 Likes

It workes. Thank you so much.
But I need one more time help. Does anyone know how to setup the smartmeter for an Iskra MT175 Meter with an USB-Reader? ( IR Schreib/Lesekopf USB (Optokopf)-ART0027 (weidmann-elektronik.de))

I got the correct configuration. Here it is:

The configuration of the sensor looks correct, but I am not sure what Transport setting should be. Can you confirm that the USB sensor is connected to USB0 under HA Settings->System->Hardware->All Hardware (3 dots top right)? Did you check using SSH that the sensor sends data?

Also make sure the sensor is oriented correctly. There is a send/recieve “bulb” on the IR sensor as well as your energy meter. Check that they are lined up (I had this issue :frowning: )

Hello Zahnweh,

as an absolute beginner I might ask stupid questions, but were exactly do I have to include the mentioned lines?
In the configuration.yaml of home assistant?

Hello,

you will have to add those lines to the add-on configuration. Navigate to your Node-RED add-on, select configuration in the top menu, hit the three dots in the upper right corner and switch to yaml.

1 Like

Excelsior!!!
After implementing all the NPM and System packages, i was able to install node-red-contrib-smartmeter.
1000 Thanks to you Zahnweh.

Although I now get another error ( smartmeter-obis error: Error: No or too long answer from Serial Device after last request) and have absolutely no clue how to solve, it still feels like victory after 4 months and lots of long nights searching for a way to get my IR Sensor talking to HA.

Fired up by this incredible good “excelsior” feeling Zahnweh’s help has given me, I am no longer to proud and stubborn to ask for help in an earlier phase…
Has anyone an idear what I have to do next and how? After 5 hours google research and “try and error” I am open for suggestions since I would like to get this thing running prior to X-Mas :wink: