Problème RFLink avec Nodejs20 Jeedom 4.4.17

Bonjour, suite au passage à Jeedom 4.4.17 et à Nodejs20, mon plugin RFLink ne fonctionne plus.
Impossible d’installer les dépendances.

+ echo '*******************Begin of package installation******************'
*******************Begin of package installation******************
+ touch /tmp/jeedom_install_in_progress_rflink
+ echo 1
+ echo 2
+ sudo chmod +x /var/www/html/core/class/../../resources/install_nodejs.sh
+ sudo /var/www/html/core/class/../../resources/install_nodejs.sh
Atteint :1 http://security.debian.org/debian-security bullseye-security InRelease
Atteint :2 http://deb.debian.org/debian bullseye InRelease
Atteint :3 http://deb.debian.org/debian bullseye-updates InRelease
Atteint :4 https://download.docker.com/linux/debian bullseye InRelease
Atteint :5 https://deb.nodesource.com/node_20.x nodistro InRelease
Lecture des listes de paquets…
Lecture des listes de paquets…
Construction de l'arbre des dépendances…
Lecture des informations d'état…
apt-utils est déjà la version la plus récente (2.2.4).
build-essential est déjà la version la plus récente (12.9).
lsb-release est déjà la version la plus récente (11.1.0).
git est déjà la version la plus récente (1:2.30.2-1+deb11u3).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 6 non mis à jour.
[Check Version NodeJS actuelle : v20.17.0 : [  OK  ]
[Check Prefix : /usr and sudo prefix : /usr and www-data prefix : /usr : [  OK  ]
Clean npm cache
npm warn using --force Recommended protections disabled.
+ echo 3
+ sudo chmod +x /var/www/html/core/class/../../resources/install_nodejs.sh
+ sudo /var/www/html/core/class/../../resources/install_nodejs.sh
Atteint :1 http://security.debian.org/debian-security bullseye-security InRelease
Atteint :2 http://deb.debian.org/debian bullseye InRelease
Atteint :3 http://deb.debian.org/debian bullseye-updates InRelease
Atteint :4 https://download.docker.com/linux/debian bullseye InRelease
Atteint :5 https://deb.nodesource.com/node_20.x nodistro InRelease
Lecture des listes de paquets…
Lecture des listes de paquets…
Construction de l'arbre des dépendances…
Lecture des informations d'état…
apt-utils est déjà la version la plus récente (2.2.4).
build-essential est déjà la version la plus récente (12.9).
lsb-release est déjà la version la plus récente (11.1.0).
git est déjà la version la plus récente (1:2.30.2-1+deb11u3).
0 mis à jour, 0 nouvellement installés, 0 à enlever et 6 non mis à jour.
[Check Version NodeJS actuelle : v20.17.0 : [  OK  ]
[Check Prefix : /usr and sudo prefix : /usr and www-data prefix : /usr : [  OK  ]
Clean npm cache
npm warn using --force Recommended protections disabled.
+ echo 4
+ sudo chmod +x /var/www/html/core/class/../../resources/install_composer.sh
+ sudo /var/www/html/core/class/../../resources/install_composer.sh
Begin installation of composer
--2024-09-13 09:00:11--  https://getcomposer.org/installer
Résolution de getcomposer.org (getcomposer.org)… 54.36.53.46, 2001:41d0:302:1100::8:104f
Connexion à getcomposer.org (getcomposer.org)|54.36.53.46|:443… connecté.
requête HTTP transmise, en attente de la réponse… 200 OK
Taille : 58444 (57K) [application/octet-stream]
Sauvegarde en : « composer-setup.php »
0K .......... .......... .......... .......... .......... 87% 1,43M 0s
50K .......                                               100%  104M=0,03s
2024-09-13 09:00:11 (1,63 MB/s) — « composer-setup.php » sauvegardé [58444/58444]
All settings correct for using Composer
Downloading...
Composer (version 2.7.9) successfully installed to: /var/www/composer.phar
Use it: php composer.phar
End installation of composer
+ echo 5
+ cd /var/www/html/core/class/../../plugins/rflink/resources
+ rm -rf node_modules
+ sudo NODE_OPTIONS=--dns-result-order=ipv4first npm install
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated uuid@3.4.0: 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.
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm error code 1
npm error path /var/www/html/plugins/rflink/resources/node_modules/@serialport/bindings
npm error command failed
npm error command sh -c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
npm error make : on entre dans le répertoire « /var/www/html/plugins/rflink/resources/node_modules/@serialport/bindings/build »
npm error   CXX(target) Release/obj.target/bindings/src/serialport.o
npm error make : on quitte le répertoire « /var/www/html/plugins/rflink/resources/node_modules/@serialport/bindings/build »
npm error prebuild-install WARN install No prebuilt binaries found (target=20.17.0 runtime=node arch=x64 libc= platform=linux)
npm error gyp info it worked if it ends with ok
npm error gyp info using node-gyp@10.1.0
npm error gyp info using node@20.17.0 | linux | x64
npm error gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
npm error gyp info spawn /usr/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/var/www/html/plugins/rflink/resources/node_modules/@serialport/bindings/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/root/.cache/node-gyp/20.17.0/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/20.17.0',
npm error gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/20.17.0/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/var/www/html/plugins/rflink/resources/node_modules/@serialport/bindings',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error gyp info spawn make
npm error gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm error In file included from ../../../nan/nan.h:178,
npm error                  from ../src/./serialport.h:13,
npm error                  from ../src/serialport.cpp:1:
npm error ../../../nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
npm error    55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm error       |                       ^~~~~~~~~~~~~~~~~
npm error ../../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
npm error    55 | typedef v8::Local<v8::AccessorSignature> Sig;
npm error       |                                        ^
npm error In file included from ../src/./serialport.h:13,
npm error                  from ../src/serialport.cpp:1:
npm error ../../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
npm error ../../../nan/nan.h:2551:16: error: no matching function for call to ‘v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>&, void (*&)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&), void (*&)(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&), v8::Local<v8::Object>&, v8::AccessControl&, v8::PropertyAttribute&, Nan::imp::Sig&)’
npm error  2551 |     , signature);
npm error       |                ^
npm error In file included from /root/.cache/node-gyp/20.17.0/include/node/v8-function.h:15,
npm error                  from /root/.cache/node-gyp/20.17.0/include/node/v8.h:33,
npm error                  from /root/.cache/node-gyp/20.17.0/include/node/node.h:73,
npm error                  from ../../../nan/nan.h:58,
npm error                  from ../src/./serialport.h:13,
npm error                  from ../src/serialport.cpp:1:
npm error /root/.cache/node-gyp/20.17.0/include/node/v8-template.h:809:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm error   809 |   void SetAccessor(
npm error       |        ^~~~~~~~~~~
npm error /root/.cache/node-gyp/20.17.0/include/node/v8-template.h:814:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
npm error   814 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm error       |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error /root/.cache/node-gyp/20.17.0/include/node/v8-template.h:816:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’
npm error   816 |   void SetAccessor(
npm error       |        ^~~~~~~~~~~
npm error /root/.cache/node-gyp/20.17.0/include/node/v8-template.h:821:22: note:   no known conversion for argument 7 from ‘Nan::imp::Sig’ {aka ‘int’} to ‘v8::SideEffectType’
npm error   821 |       SideEffectType getter_side_effect_type = SideEffectType::kHasSideEffect,
npm error       |       ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:
npm error ../src/serialport.cpp:78:51: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm error    78 |   uv_queue_work(uv_default_loop(), req, EIO_Open, (uv_after_work_cb)EIO_AfterOpen);
npm error       |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:
npm error ../src/serialport.cpp:135:53: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm error   135 |   uv_queue_work(uv_default_loop(), req, EIO_Update, (uv_after_work_cb)EIO_AfterUpdate);
npm error       |                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)’:
npm error ../src/serialport.cpp:175:52: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm error   175 |   uv_queue_work(uv_default_loop(), req, EIO_Close, (uv_after_work_cb)EIO_AfterClose);
npm error       |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)’:
npm error ../src/serialport.cpp:215:52: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm error   215 |   uv_queue_work(uv_default_loop(), req, EIO_Flush, (uv_after_work_cb)EIO_AfterFlush);
npm error       |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:
npm error ../src/serialport.cpp:271:50: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm error   271 |   uv_queue_work(uv_default_loop(), req, EIO_Set, (uv_after_work_cb)EIO_AfterSet);
npm error       |                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Get(Nan::NAN_METHOD_ARGS_TYPE)’:
npm error ../src/serialport.cpp:316:50: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm error   316 |   uv_queue_work(uv_default_loop(), req, EIO_Get, (uv_after_work_cb)EIO_AfterGet);
npm error       |                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE GetBaudRate(Nan::NAN_METHOD_ARGS_TYPE)’:
npm error ../src/serialport.cpp:366:58: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm error   366 |   uv_queue_work(uv_default_loop(), req, EIO_GetBaudRate, (uv_after_work_cb)EIO_AfterGetBaudRate);
npm error       |                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)’:
npm error ../src/serialport.cpp:412:52: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
npm error   412 |   uv_queue_work(uv_default_loop(), req, EIO_Drain, (uv_after_work_cb)EIO_AfterDrain);
npm error       |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error ../src/serialport.cpp: At global scope:
npm error ../src/serialport.cpp:433:28: warning: unnecessary parentheses in declaration of ‘ToParityEnum’ [-Wparentheses]
npm error   433 | SerialPortParity NAN_INLINE(ToParityEnum(const v8::Local<v8::String>& v8str)) {
npm error       |                            ^
npm error ../src/serialport.cpp:452:30: warning: unnecessary parentheses in declaration of ‘ToStopBitEnum’ [-Wparentheses]
npm error   452 | SerialPortStopBits NAN_INLINE(ToStopBitEnum(double stopBits)) {
npm error       |                              ^
npm error In file included from ../../../nan/nan.h:58,
npm error                  from ../src/./serialport.h:13,
npm error                  from ../src/serialport.cpp:1:
npm error /root/.cache/node-gyp/20.17.0/include/node/node.h:1232:7: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
npm error  1232 |       (node::addon_register_func) (regfunc),                          \
npm error       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error /root/.cache/node-gyp/20.17.0/include/node/node.h:1266:3: note: in expansion of macro ‘NODE_MODULE_X’
npm error  1266 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
npm error       |   ^~~~~~~~~~~~~
npm error ../src/serialport.cpp:486:1: note: in expansion of macro ‘NODE_MODULE’
npm error   486 | NODE_MODULE(serialport, init);
npm error       | ^~~~~~~~~~~
npm error make: *** [bindings.target.mk:111 : Release/obj.target/bindings/src/serialport.o] Erreur 1
npm error gyp ERR! build error
npm error gyp ERR! stack Error: `make` failed with exit code: 2
npm error gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
npm error gyp ERR! System Linux 5.10.0-31-amd64
npm error gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /var/www/html/plugins/rflink/resources/node_modules/@serialport/bindings
npm error gyp ERR! node -v v20.17.0
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: /root/.npm/_logs/2024-09-13T07_00_12_579Z-debug-0.log
+ sudo chown -R www-data:www-data nodejs.sh package.json package-lock.json rflink rflink.js update_firmware.sh
+ echo 6
+ php /var/www/html/core/class/../php/jeecli.php plugin dependancy_end rflink
+ echo 7
+ rm /tmp/jeedom_install_in_progress_rflink
+ echo '*******************End of package installation******************'
*******************End of package installation******************

Est ce que RFLink peut fonctionner avec NodeJs20 ? Si oui que dois je faire ?

Bonjour,

Vous êtes en debian 10 ou 11 ?

Je pense que le plugin doit être mis à jour pour devenir compatible.

Je pense que le problème vient de la.

Je viens de faire la suppression du plugin, puis sa réinstallation et ça fonctionne.
Par contre, j’aimerais éviter de faire ça car je perds toutes mes commandes lié au plugin RFLink, je suis donc revenu en arrière avec ma sauvegarde.
Que puis je faire, pour retrouver le fonctionnel de RFLink sans devoir passer par la désinstallation ?

Non, ce sont des alertes, mais le problème ne vient pas de là, c’est la compilation avec NodeJs20 qui semble mal se faire sans désinstaller le plugin…

Debian 10 ou 11 ?

Bulleyes, voir les logs et les dépôts pour les dépendances.

Antoine

1 « J'aime »

Je suis sous Debian 11

J’ai trouvé la solution, forcé la plugin en bêta pour qu’il recompile avec Nodejs20, puis repasser à la version stable…

Bonjour, j’ai le même problème mais comment fais tu pour forcer le plugin en bêta ? J’ai essayé en allant dans le store pour le prendre en Béta mais j’ai toujours l’erreur.

Bonjour,

Je me suis retrouvé dans le même cas que toi, malgré la réinstallation du plugin ou l’installation du plugin en bêta, ça n’arrangeait rien.
J’ai même pris ma SD de secours avec un jeedom vierge sur lequel j’ai restauré ma sauvegarde mais le problème était le même.

J’ai fini par tenter une manipulation qui a marché mais je ne suis pas sûr que la méthode soit très conventionnelle…

  • Sauvegarde de Jeedom depuis l’interface web
  • Suppression du plugin depuis la page de configuration
  • Réinstallation du plugin et des dépendances (j’avais espoir de pouvoir reconfigurer facilement à l’identique mais non :sweat_smile:)
  • Restauration de ma sauvegarde
  • A partir de là, je ne sais pas si j’ai dû réinstaller les dépendances ou pas mais ce qui est sûr, c’est que RFLink était à nouveau opérationnel.

PS: Debian 11 et Jeedom 4.4.17

1 « J'aime »

Salut!
Je viens de tester ta méthode et elle a fonctionnée aussi chez moi :grinning:
Merci

Jeedom 4.4.18 sur Debian 12 (RaspberryPi 5)

Ce sujet a été automatiquement fermé après 24 heures suivant le dernier commentaire. Aucune réponse n’est permise dorénavant.