Problème d'installation JeeZigbee

Bonjour

Je n’arrive pas à installer / lancer le démon JeeZigbee.

J’ai installé et configuré MQTT manager, tout à l’air OK :

J’ai installé JeeZigbee, les dépendances sont installés sans message d’erreur mais le démon ne se lance pas.

Le fichiers z2md :

> zigbee2mqtt@1.35.3 start /var/www/html/plugins/z2m/resources/zigbee2mqtt
> node index.js
node:internal/modules/cjs/loader:1080
throw err;
^
Error: Cannot find module 'semver'
Require stack:
- /var/www/html/plugins/z2m/resources/zigbee2mqtt/index.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:121:18)
at Object.<anonymous> (/var/www/html/plugins/z2m/resources/zigbee2mqtt/index.js:1:16)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/var/www/html/plugins/z2m/resources/zigbee2mqtt/index.js' ]
}
Node.js v18.17.1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zigbee2mqtt@1.35.3 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zigbee2mqtt@1.35.3 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-02-24T16_06_47_823Z-debug.log

Le fichier /root/.npm/_logs/2024-02-24T16_06_47_823Z-debug.log :

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'start',
1 verbose cli   '--prefix',
1 verbose cli   '/var/www/html/plugins/z2m/resources/zigbee2mqtt'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v18.17.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle zigbee2mqtt@1.35.3~prestart: zigbee2mqtt@1.35.3
6 info lifecycle zigbee2mqtt@1.35.3~start: zigbee2mqtt@1.35.3
7 verbose lifecycle zigbee2mqtt@1.35.3~start: unsafe-perm in lifecycle true
8 verbose lifecycle zigbee2mqtt@1.35.3~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/html/plugins/z2m/resources/zigbee2mqtt/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle zigbee2mqtt@1.35.3~start: CWD: /var/www/html/plugins/z2m/resources/zigbee2mqtt
10 silly lifecycle zigbee2mqtt@1.35.3~start: Args: [ '-c', 'node index.js' ]
11 silly lifecycle zigbee2mqtt@1.35.3~start: Returned: code: 1  signal: null
12 info lifecycle zigbee2mqtt@1.35.3~start: Failed to exec start script
13 verbose stack Error: zigbee2mqtt@1.35.3 start: `node index.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (node:events:514:28)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (node:events:514:28)
13 verbose stack     at maybeClose (node:internal/child_process:1091:16)
13 verbose stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
14 verbose pkgid zigbee2mqtt@1.35.3
15 verbose cwd /var/www/html/core/ajax
16 verbose Linux 5.10.103-v7l+
17 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "start" "--prefix" "/var/www/html/plugins/z2m/resources/zigbee2mqtt"
18 verbose node v18.17.1
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error zigbee2mqtt@1.35.3 start: `node index.js`
22 error Exit status 1
23 error Failed at the zigbee2mqtt@1.35.3 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Quand je regarde les logs de z2m_packages je vois une erreur :

+ echo '*******************Begin of package installation******************'
*******************Begin of package installation******************
+ touch /tmp/jeedom_install_in_progress_z2m
+ echo 1
+ echo 2
+ sudo chmod +x /var/www/html/core/class/../../plugins/z2m/resources/pre-install.sh
+ sudo /var/www/html/core/class/../../plugins/z2m/resources/pre-install.sh
Launch pre-install of z2m dependancy
+ echo 3
+ sudo chmod +x /var/www/html/core/class/../../plugins/z2m/resources/post-install.sh
+ sudo /var/www/html/core/class/../../plugins/z2m/resources/post-install.sh
+ echo Launch post-install of z2m dependancy
Launch post-install of z2m dependancy
+ realpath /var/www/html/core/class/../../plugins/z2m/resources/post-install.sh
+ dirname /var/www/html/plugins/z2m/resources/post-install.sh
+ BASEDIR=/var/www/html/plugins/z2m/resources
+ [ -d /var/www/html/plugins/z2m/resources/zigbee2mqtt ]
+ rm -rf /var/www/html/plugins/z2m/resources/zigbee2mqtt
+ mkdir /var/www/html/plugins/z2m/resources/zigbee2mqtt
+ git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /var/www/html/plugins/z2m/resources/zigbee2mqtt
Cloning into '/var/www/html/plugins/z2m/resources/zigbee2mqtt'...
+ cd /var/www/html/plugins/z2m/resources/zigbee2mqtt
+ [ -f /var/www/html/plugins/z2m/resources/../data/wanted_z2m_version ]
+ npm ci
npm ERR! Cannot read properties of undefined (reading 'ajv')
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-02-24T15_41_22_232Z-debug.log
+ npm run build
> zigbee2mqtt@1.35.3 build /var/www/html/plugins/z2m/resources/zigbee2mqtt
> tsc && node index.js writehash
sh: 1: tsc: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! zigbee2mqtt@1.35.3 build: `tsc && node index.js writehash`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the zigbee2mqtt@1.35.3 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-02-24T15_41_23_314Z-debug.log
+ chown www-data:www-data -R /var/www/html/plugins/z2m/resources/zigbee2mqtt
+ echo 4
+ php /var/www/html/core/class/../php/jeecli.php plugin dependancy_end z2m
+ rm /tmp/jeedom_install_in_progress_z2m
+ echo '*******************End of package installation******************'
*******************End of package installation******************

Je suis sur Debian Buster à jour et en Core: 4.3.22.
J’ai trouvé un post avec un erreur comparable mais la solution était d’upgrader le core et je sui déjà à jour.

Pourriez-vous m’aider à débloquer ce pb ?

Merci

npm@10.2.4 pour ma part .

Je ferai mais ce n’est que moi

sudo npm cache clean --force

Et je relancerais les dépendances de Jeezigbee…

Je ne dis pas de le faire !

Merci,
J’ai passé la commande et relancer l’installation des dépendance, le résultat et le même.

Je veux bien essayer d’upgrader npm, comment procéder sur buster, avec une autre source apt ?

sudo apt install npm

précision importante, je suis sur Raspbian.

le apt install refuse de l’installer :

Les paquets suivants contiennent des dépendances non satisfaites :
 npm : Dépend: nodejs (>= 6.11~) mais ne sera pas installé
       Dépend: node-abbrev (>= 1.1.1~) mais ne sera pas installé
       Dépend: node-ansi-regex (>= 3.0~) mais ne sera pas installé
       .....

Bonjour
Peux tu mettre une capture de la page santé ?

La voici :

Info complémentaire, le module Zwave-JS fonctionne très bien, il me semble qu’il utilise également MQTT.

Je pense tu as un soucis nodejs tu peux mettre à jour jeedom même si il te propose rien et mettre la log ?

[START UPDATE]
****Update from 4.3.22 (2024-02-24 18:25:04)****
Parameters : {"preUpdate":"0","backup::before":"0","plugins":"0","core":"1","force":"0","update::reapply":""}
Send begin of update event | OK
Check rights | OK
Download url : https://github.com/jeedom/core/archive/V4-stable.zip
Download in progress--2024-02-24 18:25:16--  https://github.com/jeedom/core/archive/V4-stable.zip
Resolving github.com (github.com) 140.82.121.4
Connecting to github.com (github.com)|140.82.121.4|:443 connected.
HTTP request sent, awaiting response 302 Found
Location: https://codeload.github.com/jeedom/core/zip/refs/heads/V4-stable [following]
--2024-02-24 18:25:16--  https://codeload.github.com/jeedom/core/zip/refs/heads/V4-stable
Resolving codeload.github.com (codeload.github.com) 140.82.121.10
Connecting to codeload.github.com (codeload.github.com)|140.82.121.10|:443 connected.
HTTP request sent, awaiting response
200 | OK
Length: 85085607 (81M) [application/zip]
Saving to: '/tmp/jeedom/install/jeedom_update.zip'
0K        3% 14.8M 5s
3072K        7% 24.1M 4s
6144K       11% 18.5M 4s
9216K       14% 22.6M 4s
12288K       18% 22.9M 3s
15360K       22% 23.4M 3s
18432K
25% 21.1M 3s
21504K       29% 24.2M 3s
24576K       33% 22.9M 3s
27648K       36% 24.3M 2s
30720K       40% 22.2M 2s
33792K       44% 23.5M 2s
36864K       48% 24.3M 2s
39936K       51% 24.1M 2s
43008K       55% 22.4M 2s
46080K
59% 21.6M 2s
49152K       62% 23.3M 1s
52224K       66% 23.6M 1s
55296K       70% 22.8M 1s
58368K       73% 21.7M 1s
61440K       77% 24.3M 1s
64512K       81% 24.4M 1s
67584K       85% 24.4M 1s
70656K       88% 23.8M 0s
73728K
92% 23.6M 0s
76800K       96% 24.1M 0s
79872K       99% 25.0M 0s
82944K                                                    100% 24.9M=3.6s
2024-02-24 18:25:20 (22.6 MB/s) - '/tmp/jeedom/install/jeedom_update.zip' saved [85085607/85085607] | OK
Cleaning folders | OK
Create temporary folder | OK
Unzip in progress | OK
Clean temporary files (tmp) | OK
Disable all task.
. | OK
Disable all scenario
 | OK
Moving files
Ignore file /tmp/jeedom_unzip/core-4-stable///docs/de_DE/noteVersion.md because size is 0
Ignore file /tmp/jeedom_unzip/core-4-stable///docs/en_US/noteVersion.md because size is 0
Ignore file /tmp/jeedom_unzip/core-4-stable///docs/es_ES/noteVersion.md because size is 0
Ignore file /tmp/jeedom_unzip/core-4-stable///docs/fr_FR/noteVersion.md because size is 0
Ignore file /tmp/jeedom_unzip/core-4-stable///docs/pt_PT/noteVersion.md because size is 0 | OK
Remove temporary files | OK
Remove useless files
Cleaning 3rdparty
Cleaning desktop
Cleaning mobile
Cleaning core
Cleaning docs
Cleaning install
Cleaning script
Cleaning vendor
Check jeedom consistency
[START CONSISTENCY]
[START CHECK AND FIX DB]
[END CHECK AND FIX DB]
Check jeedom package | OK
Check jeedom database | OK
Check crons
Check filesystem right | OK
Flush cache widget
Check jeedom object | OK
Check jeedom cmd | OK
Set cache hour | OK
Check nodejs
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Hit:3 http://phoscon.de/apt/deconz buster InRelease
Hit:4 https://deb.nodesource.com/node_18.x buster InRelease
Fetched 15.0 kB in 1s (12.7 kB/s)
Reading package lists
Reading package lists
Building dependency tree
Reading state information
apt-utils is already the newest version (1.8.2.3).
build-essential is already the newest version (12.6).
git is already the newest version (1:2.20.1-2+deb10u8).
lsb-release is already the newest version (10.2019051400+rpi1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[Check Version NodeJS actuelle : v18.17.1 : [  OK  ]
[Check Prefix : /usr/local and sudo prefix : /usr/local and www-data prefix : /usr/local : [  OK  ] | OK
[END CONSISTENCY] | OK
Check update | OK
***************Jeedom is up to date in 4.3.22***************
Check update | OK
Enable scenario : | OK
Enable task : | OK
Launch cron dependancy plugins | OK
Send end of update event | OK
Update duration : 53s
[END UPDATE SUCCESS]

Le problème est plus chiant je pense tu dois avoir un node et un nodejs pas à la même version tout tous tes soucis. Le mieux la c’est récupérer un backup refaire une installation de ton rpi remettre jeedom et remettre ton backup

Merci pour le diagnostic
Il n’y a pas une méthode un peu moins radicale ?
Je ne peux pas essayer de reinstaller ces modules ?

Oui y’a moyen sans réinstaller en virant le node qui va pas mais c’est beaucoup plus compliqué la moindre erreur tu casses tout et nécessite de bonne connaissance os.

Et en supprimant et réinstallant Jeedom mais pas tout l’OS ?

Non tu peux tenter de virer node et nodejs relancer une maj de jeedom et prier que tout rentre dans l’ordre

ok ça peut être une étape avant de tout résinstaller, comment supprimer node et nodejs ?

Je vais faire une sauvegarde complète de mon système avant.

Après c’est cette commande ?

apt remove nodejs
sudo apt remove nodejs

ensuite pour vérifier si c’est désinstallé ceci ne doit rien renvoyer

node --version
npm --version

Ca ce n’est pas trop possible

Oui et pareil pour node

j’ai fait la manip et ça ne change rien

Bonjour
Je me suis résolu à tout reinstaller, ton diagnostic était bon, cela a résolu le problème.
Merci pour ton aide.