Problème installation de npm

Bonjour,

Raspberry Pi4 B 4Go
Debian GNU/Linux 11 (bullseye)
Jeedom 4.4.12
mySensors version 2023-10-26 01:02:00

Je n’arrive toujours pas à faire fonctionner mySensors
J’ai bien fait la modification du fichier packages.json comme le suggère @akenad
mais ça ne fonctionne pas chez moi.

Historiquement je suis parti d’un jeedom v4.3.20 sur rpi3b avec une sauvegarde et une page santé OK pour migration vers Pi4 B avec dernière version de jeedom.

Merci pour votre aide…

Jean-luc

+ sudo apt update

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Hit:1 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease
Hit:3 http://security.debian.org/debian-security bullseye-security InRelease
Hit:4 http://deb.debian.org/debian bullseye-updates InRelease
Hit:5 https://deb.nodesource.com/node_20.x nodistro InRelease
Reading package lists...
Building dependency tree...
Reading state information...
All packages are up to date.
+ cd /var/www/html/core/class/../../plugins/mySensors/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/mySensors/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: Entering directory '/var/www/html/plugins/mySensors/resources/node_modules/@serialport/bindings/build'
npm error   CXX(target) Release/obj.target/bindings/src/serialport.o
npm error make: Leaving directory '/var/www/html/plugins/mySensors/resources/node_modules/@serialport/bindings/build'
npm error prebuild-install WARN install No prebuilt binaries found (target=20.18.1 runtime=node arch=arm64 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.18.1 | linux | arm64
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/mySensors/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.18.1/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.18.1',
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.18.1/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/var/www/html/plugins/mySensors/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.18.1/include/node/v8-function.h:15,
npm error                  from /root/.cache/node-gyp/20.18.1/include/node/v8.h:33,
npm error                  from /root/.cache/node-gyp/20.18.1/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.18.1/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.18.1/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.18.1/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.18.1/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.18.1/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.18.1/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:109: Release/obj.target/bindings/src/serialport.o] Error 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 6.1.21-v8+
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/mySensors/resources/node_modules/@serialport/bindings
npm error gyp ERR! node -v v20.18.1
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/2025-01-06T10_32_27_706Z-debug-0.log
+ sudo chown -R www-data:www-data install.sh mysensors.js nodejs.sh package-lock.json package.json

Bonjour,

la modification du fichier packages.json que j’avais indiqué en janvier 2023
ici : Plugin qui ne démarre pas, problème avec nodejs - #4 par akenad
n’est plus nécessaire car,
une partie a été depuis intégré par le dev du plugin et l’autre partie, NodeJS est maintenant installé par Jeedom.

C’était nécessaire mais ce n’est aujourd’hui plus suffisant :
Depuis le passage à Debian 11 et Node v20, le problème se situe au niveau de la compilation du module node serialport.
Cela semble passer avec une VM mais par avec un RPi (pas de version pré-compilée trouvée).

Après mise à jour en Jeedom 4.4.19, tu peux tenter manuellement pour voir ce qui se passe :
en ssh :

cd /var/www/html/plugins/mySensors/resources/node_modules

sudo npm install serialport

akenad :slight_smile:

Bonjour @akenad

Merci pour ton aide si rapide

j’ai fait mise à jour en 4.4.19

En ssh, le répertoire /node_module est inexistant et j’ai tout de même
fait sudo npm install serialport sous le répertoire /resources

Le résultat n’est pas bon et je n’ai pas les compétences pour comprendre ce qui ne va pas…

Merci pour ton aide

Jean-luc

-bash: cd: node_modules: No such file or directory
jeanl@raspberrypi:/var/www/html/plugins/mySensors/resources $ ls
install.sh  mysensors.js  nodejs.sh  package.json  package-lock.json
jeanl@raspberrypi:/var/www/html/plugins/mySensors/resources $
jeanl@raspberrypi:/var/www/html/plugins/mySensors/resources $
jeanl@raspberrypi:/var/www/html/plugins/mySensors/resources $ sudo npm install serialport
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/mySensors/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: Entering directory '/var/www/html/plugins/mySensors/resources/node_modules/@serialport/bindings/build'
npm error   CXX(target) Release/obj.target/bindings/src/serialport.o
npm error make: Leaving directory '/var/www/html/plugins/mySensors/resources/node_modules/@serialport/bindings/build'
npm error prebuild-install WARN install No prebuilt binaries found (target=20.18.1 runtime=node arch=arm64 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.18.1 | linux | arm64
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/mySensors/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.18.1/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.18.1',
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.18.1/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/var/www/html/plugins/mySensors/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::PropertyCallba                                                                                             ckInfo<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.18.1/include/node/v8-function.h:15,
npm error                  from /root/.cache/node-gyp/20.18.1/include/node/v8.h:33,
npm error                  from /root/.cache/node-gyp/20.18.1/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.18.1/include/node/v8-template.h:809:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::S                                                                                             tring>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEffectTy                                                                                             pe, v8::SideEffectType)’
npm error   809 |   void SetAccessor(
npm error       |        ^~~~~~~~~~~
npm error /root/.cache/node-gyp/20.18.1/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.18.1/include/node/v8-template.h:816:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::N                                                                                             ame>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, v8::SideEf                                                                                             fectType, v8::SideEffectType)’
npm error   816 |   void SetAccessor(
npm error       |        ^~~~~~~~~~~
npm error /root/.cache/node-gyp/20.18.1/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.18.1/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::L                                                                                             ocal<v8::Value>, void*)’} [-Wcast-function-type]
npm error  1232 |       (node::addon_register_func) (regfunc),                          \
npm error       |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npm error /root/.cache/node-gyp/20.18.1/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:109: Release/obj.target/bindings/src/serialport.o] Error 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 6.1.21-v8+
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/mySensors/resources/node_modules/@serialport/bindings
npm error gyp ERR! node -v v20.18.1
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/2025-01-06T14_27_25_940Z-debug-0.log
jeanl@raspberrypi:/var/www/html/plugins/mySensors/resources $

(pour information, les dépendances s’installent sur un RPi4 sous Debian 12).

Dans le log MySensors_packages dans ton premier post on voit que le dossier node_modules est supprimé :

Tu peux tenter de supprimer package-lock.json :

sudo rm /var/www/html/plugins/mySensors/resources/package-lock.json

et de relancer l’installation des dépendances.
(et de voir si le dossier node_modules est recréé.)

akenad :slight_smile:

1 « J'aime »

C’est bizarre, j’ai mysensors qui fonctionne sans problème ; sur PI3b+, PI4, et PI5

j’ai fais récemment des installs sur pi4 en deb11 et pi5 en deb12, l’install se passe bien ; il n’y a plus à faire la modification d’ @akenad je pense.

Oui, c’est ce que j’explique dans mon premier post.

akenad :slight_smile:

Bravo, ça a fonctionné

Encore merci pour ton aide

Du coup il faut remettre le fichier packages.json en son état d’origine ?

+ echo '*******************Begin of package installation******************'
*******************Begin of package installation******************
+ touch /tmp/jeedom_install_in_progress_mySensors
+ 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
Hit:1 http://deb.debian.org/debian bullseye InRelease
Hit:2 http://deb.debian.org/debian bullseye-updates InRelease
Hit:3 http://security.debian.org/debian-security bullseye-security InRelease
Hit:4 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:5 https://deb.nodesource.com/node_20.x nodistro InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
apt-utils is already the newest version (2.2.4).
build-essential is already the newest version (12.9).
lsb-release is already the newest version (11.1.0).
git is already the newest version (1:2.30.2-1+deb11u3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[Check Version NodeJS actuelle : v20.18.1 : [  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
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Hit:4 http://archive.raspberrypi.org/debian bullseye InRelease
Hit:5 https://deb.nodesource.com/node_20.x nodistro InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
apt-utils is already the newest version (2.2.4).
build-essential is already the newest version (12.9).
lsb-release is already the newest version (11.1.0).
git is already the newest version (1:2.30.2-1+deb11u3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
[Check Version NodeJS actuelle : v20.18.1 : [  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
--2025-01-06 16:15:50--  https://getcomposer.org/installer
Resolving getcomposer.org (getcomposer.org)... 2001:41d0:302:1100::8:104f, 54.36.53.46
Connecting to getcomposer.org (getcomposer.org)|2001:41d0:302:1100::8:104f|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 58444 (57K) [application/octet-stream]
Saving to: ‘composer-setup.php’

     0K .......... .......... .......... .......... .......... 87% 2.75M 0s
    50K .......                                               100% 31.9M=0.02s

2025-01-06 16:15:50 (3.10 MB/s) - ‘composer-setup.php’ saved [58444/58444]

All settings correct for using Composer
Downloading...

Composer (version 2.8.4) 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/mySensors/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

added 101 packages, and audited 102 packages in 32s

25 packages are looking for funding
  run `npm fund` for details

2 moderate severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
+ sudo chown -R www-data:www-data install.sh mysensors.js nodejs.sh node_modules package.json package-lock.json
+ echo 6
+ php /var/www/html/core/class/../php/jeecli.php plugin dependancy_end mySensors
+ echo 7
+ rm /tmp/jeedom_install_in_progress_mySensors
+ echo '*******************End of package installation******************'
*******************End of package installation******************

le fichier plugins/mySensors/plugin_info/packages.json
n’a plus besoin d’être modifié manuellement directement depuis le 26/10/2023.
il contient après installation du plugin mySensors du 2023-10-26 :

{
  "npm" : {
    "plugins/mySensors/resources": {}
    }
  }

C’est la suppression de resources/package-lock.json
qui a solutionné le problème de non ré-installation des dépendances.

akenad :slight_smile:

C’est un autre problème qui n’est pas lié à la ré-installation des dépendances.

akenad :slight_smile:

Exact, une idée ?

Je n’utilise pas ce plugin.
Quelqu’un qui l’utilise pourra peut-être t’aider.
je t’invite à ouvrir un nouveau sujet, avec plus de détails sur ton problème (copies écrans).

akenad :slight_smile:

@hlehoux

Tu as eu ce problème de perte des liens ?

Jean-luc

Non. Essaye de recharger une sauvegarde maintenant que tes dépendances sont ok

Oui mais du coup je vais revenir à un jeedom V4.3.20

Ca pose pas de problème ?

La seule chose que je sais dire c’est que mysensors fonctionnait bien chez moi sur un RPI4 à l’époque de la 4.3.20

Oui chez moi aussi ça fonctionne bien avec la 4.3.20

Le problème semble venir au passage à la 4.4

J’ai essayé l’inclusion d’un nouveau node.
L’inclusion se passe bien mais les champs de lien sont vides et ne proposent que « aucune ».
Si on sauvegarde ils se remplissent avec la valeur « aucune »
L’action on off fonctionne bien avec les bouton « Tester » ou en commande dans un scénario.
Mais bien sur impossible de commander sur le dashbord !

Ce problème a déjà été signalé en octobre 2024 par @piter13

Passage luna de 4.3.23 vers 4.4.11 (passerelle my sensors)

Tu as moyen d’essayer en 4.4.19 pour voir si ça fonctionne chez toi ?

Merci.
Jean-luc

Je suis en 4.4.19 sur un RPI5/debian 12 et un RPI4/debian 11.

Mais en fait je pense que j’ai le même problème que toi:

Juste je ne m’en étais pas aperçu car je n’avais pas essayé depuis le dashboard depuis longtemps

J’ai parcouru un peu le forum, si je comprend bien c’est peut-être lié au passage à nodejs 20.
faudrait essayer en 4.4.16 (nodejs 18)

@lunarok bonjour à toi, saurais-tu nous éclairer un peu s’il te plaît ?

Sur la Luna de @piter ça ne fonctionne pas en 4.4.11, je ne sais pas quelle version
de nodejs c’était ?

Vous êtes hors sujet et en plus ces derniers échanges font doublon avec l’autre post que vous mentionnez
Une question/un problème = un sujet.