I am trying to install node-red-contrib-dht-sensor. I have followed the three steps which are:
Step 1- Installing BCM2835 library
Step 2 & 3 - Install the node-dht-sensor dependency
nodejs version: v12.22.12
npm version: 8.19.2
However, it is not installed. Here is the error message that I get:
2022-10-21T12:02:01.048Z Install : node-red-contrib-dht-sensor 1.0.4
2022-10-21T12:02:01.217Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-dht-sensor@1.0.4
2022-10-21T12:02:14.116Z [err] npm ERR! code 1
2022-10-21T12:02:14.116Z [err] npm ERR! path /home/pi/.node-red/node_modules/node-dht-sensor
2022-10-21T12:02:14.129Z [err] npm
2022-10-21T12:02:14.130Z [err] ERR! command failed
2022-10-21T12:02:14.130Z [err] npm ERR! command sh -c node-gyp configure
2022-10-21T12:02:14.130Z [err] npm
2022-10-21T12:02:14.130Z [err] ERR! gyp info it worked if it ends with ok
2022-10-21T12:02:14.130Z [err] npm
2022-10-21T12:02:14.130Z [err] ERR! gyp info using node-gyp@3.8.0
2022-10-21T12:02:14.131Z [err] npm ERR!
2022-10-21T12:02:14.131Z [err] gyp info using node@12.22.12 | linux | arm
2022-10-21T12:02:14.131Z [err] npm
2022-10-21T12:02:14.131Z [err] ERR! gyp ERR! configure error
2022-10-21T12:02:14.131Z [err] npm
2022-10-21T12:02:14.131Z [err] ERR! gyp ERR! stack Error: Command failed: /usr/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
2022-10-21T12:02:14.131Z [err] npm ERR!
2022-10-21T12:02:14.131Z [err] gyp ERR! stack File "", line 1
2022-10-21T12:02:14.131Z [err] npm
2022-10-21T12:02:14.131Z [err] ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
2022-10-21T12:02:14.131Z [err] npm ERR!
2022-10-21T12:02:14.132Z [err] gyp ERR! stack ^
2022-10-21T12:02:14.132Z [err] npm ERR!
2022-10-21T12:02:14.132Z [err] gyp ERR! stack SyntaxError: invalid syntax
2022-10-21T12:02:14.132Z [err] npm
2022-10-21T12:02:14.132Z [err] ERR! gyp ERR! stack
2022-10-21T12:02:14.132Z [err] npm
2022-10-21T12:02:14.132Z [err] ERR!
2022-10-21T12:02:14.132Z [err] gyp ERR! stack at ChildProcess.exithandler (child_process.js:308:12)
2022-10-21T12:02:14.132Z [err] npm ERR!
2022-10-21T12:02:14.132Z [err] gyp ERR! stack at ChildProcess.emit (events.js:314:20)
2022-10-21T12:02:14.132Z [err] npm
2022-10-21T12:02:14.132Z [err] ERR! gyp ERR! stack at maybeClose (internal/child_process.js:1022:16)
2022-10-21T12:02:14.132Z [err] npm
2022-10-21T12:02:14.133Z [err] ERR!
2022-10-21T12:02:14.133Z [err] gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
2022-10-21T12:02:14.133Z [err] npm ERR!
2022-10-21T12:02:14.133Z [err] gyp ERR! System Linux 5.15.61-v7+
2022-10-21T12:02:14.133Z [err] npm
2022-10-21T12:02:14.133Z [err] ERR! gyp ERR! command "/usr/bin/node" "/home/pi/.node-red/node_modules/.bin/node-gyp" "configure"
2022-10-21T12:02:14.133Z [err] npm
2022-10-21T12:02:14.133Z [err] ERR! gyp ERR! cwd /home/pi/.node-red/node_modules/node-dht-sensor
2022-10-21T12:02:14.133Z [err] npm ERR!
2022-10-21T12:02:14.133Z [err] gyp ERR! node -v v12.22.12
2022-10-21T12:02:14.133Z [err] npm ERR!
2022-10-21T12:02:14.134Z [err] gyp ERR! node-gyp -v v3.8.0
2022-10-21T12:02:14.134Z [err] npm
2022-10-21T12:02:14.134Z [err] ERR! gyp ERR! not ok
2022-10-21T12:02:14.206Z [err]
2022-10-21T12:02:14.206Z [err] npm ERR!
2022-10-21T12:02:14.206Z [err] A complete log of this run can be found in:
2022-10-21T12:02:14.206Z [err] npm ERR! /home/pi/.npm/_logs/2022-10-21T12_02_14_140Z-debug.log
2022-10-21T12:02:14.232Z rc=1