NEWS
Error i2c adapter after upgrade of node.js version 22
-
-
@thomas-braun Vielen Dank, ich probiere und melde mich, wird wahrscheinlich am Feiertag passieren. Danke euch allen.
-
@hschief So, habe gerade nochmal 2 Dinge probiert. Einfach drüber installieren mit iob url iobroker.i2c@1.2.1 zeigt leider das gleiche Ergebnis/gleicher Fehler
Dann habe ich noch node-gyp installiert, mich auf den folder /opt/iobroker/node_modules/i2c-bus/ gesetzt und node-gyp rebuild ausgeführt (war ja etwas weiter oben aufgelistet, keine Ahnung was das macht) Wenn ich das Kommando ausführe, kommen folgende Meldungen: Vielleicht kann einer damit was anfangen. Im nächsten Schritt werde ich den Adapter morgen mal komplett deinstallieren und neu installieren.
iobroker@node0:/opt/iobroker/node_modules/i2c-bus $ node-gyp rebuild gyp info it worked if it ends with ok gyp info using node-gyp@11.4.2 gyp info using node@22.20.0 | linux | arm64 gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3" gyp info spawn /usr/bin/python3 gyp info spawn args [ gyp info spawn args '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py', gyp info spawn args 'binding.gyp', gyp info spawn args '-f', gyp info spawn args 'make', gyp info spawn args '-I', gyp info spawn args '/opt/iobroker/node_modules/i2c-bus/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/usr/lib/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/home/iobroker/.cache/node-gyp/22.20.0/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/home/iobroker/.cache/node-gyp/22.20.0', gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/home/iobroker/.cache/node-gyp/22.20.0/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/opt/iobroker/node_modules/i2c-bus', gyp info spawn args '-Dnode_engine=v8', gyp info spawn args '--depth=.', gyp info spawn args '--no-parallel', gyp info spawn args '--generator-output', gyp info spawn args 'build', gyp info spawn args '-Goutput_dir=.' gyp info spawn args ] gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory '/opt/iobroker/node_modules/i2c-bus/build' CXX(target) Release/obj.target/i2c/src/i2c.o In file included from ../src/i2c.cc:2: ../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, imp::Sig)’: ../../nan/nan.h:2548:19: 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&)’ 2548 | tpl->SetAccessor( | ~~~~~~~~~~~~~~~~^ 2549 | name | ~~~~ 2550 | , getter_ | ~~~~~~~~~ 2551 | , setter_ | ~~~~~~~~~ 2552 | , obj | ~~~~~ 2553 | , settings | ~~~~~~~~~~ 2554 | , attribute | ~~~~~~~~~~~ 2555 | #if (NODE_MODULE_VERSION < NODE_16_0_MODULE_VERSION) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2556 | , signature | ~~~~~~~~~~~ 2557 | #endif | ~~~~~~ 2558 | ); | ~ In file included from /home/iobroker/.cache/node-gyp/22.20.0/include/node/v8-function.h:15, from /home/iobroker/.cache/node-gyp/22.20.0/include/node/v8.h:33, from /home/iobroker/.cache/node-gyp/22.20.0/include/node/node.h:74, from ../src/i2c.cc:1: /home/iobroker/.cache/node-gyp/22.20.0/include/node/v8-template.h:1049:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’ 1049 | void SetAccessor( | ^~~~~~~~~~~ /home/iobroker/.cache/node-gyp/22.20.0/include/node/v8-template.h:1052:61: note: no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’ 1052 | Local<Value> data = Local<Value>(), PropertyAttribute attribute = None, | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /home/iobroker/.cache/node-gyp/22.20.0/include/node/v8-template.h:1055:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’ 1055 | void SetAccessor( | ^~~~~~~~~~~ /home/iobroker/.cache/node-gyp/22.20.0/include/node/v8-template.h:1058:61: note: no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’ 1058 | Local<Value> data = Local<Value>(), PropertyAttribute attribute = None, | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ ../../nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, GetterCallback, SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’: ../../nan/nan.h:2594:19: 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&)’ 2594 | tpl->SetAccessor( | ~~~~~~~~~~~~~~~~^ 2595 | name | ~~~~ 2596 | , getter_ | ~~~~~~~~~ 2597 | , setter_ | ~~~~~~~~~ 2598 | , obj | ~~~~~ 2599 | , settings | ~~~~~~~~~~ 2600 | , attribute | ~~~~~~~~~~~ 2601 | ); | ~ /home/iobroker/.cache/node-gyp/22.20.0/include/node/v8-template.h:1049:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::String>, v8::AccessorGetterCallback, v8::AccessorSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’ 1049 | void SetAccessor( | ^~~~~~~~~~~ /home/iobroker/.cache/node-gyp/22.20.0/include/node/v8-template.h:1052:61: note: no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’ 1052 | Local<Value> data = Local<Value>(), PropertyAttribute attribute = None, | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /home/iobroker/.cache/node-gyp/22.20.0/include/node/v8-template.h:1055:8: note: candidate: ‘void v8::ObjectTemplate::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::PropertyAttribute, v8::SideEffectType, v8::SideEffectType)’ 1055 | void SetAccessor( | ^~~~~~~~~~~ /home/iobroker/.cache/node-gyp/22.20.0/include/node/v8-template.h:1058:61: note: no known conversion for argument 5 from ‘v8::AccessControl’ to ‘v8::PropertyAttribute’ 1058 | Local<Value> data = Local<Value>(), PropertyAttribute attribute = None, | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ make: *** [i2c.target.mk:112: Release/obj.target/i2c/src/i2c.o] Error 1 make: Leaving directory '/opt/iobroker/node_modules/i2c-bus/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules/node-gyp/lib/build.js:219:23) gyp ERR! System Linux 6.12.47+rpt-rpi-v8 gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild" gyp ERR! cwd /opt/iobroker/node_modules/i2c-bus gyp ERR! node -v v22.20.0 gyp ERR! node-gyp -v v11.4.2 gyp ERR! not ok iobroker@node0:/opt/iobroker/node_modules/i2c-bus $
-
Warum nicht mit dem Befehl von mir?
-
@thomas-braun Hi, der node-gyp rebuild war doch von Dir. Ich habe nur das "add i2c" nicht gemacht, da der Adapter ja schon da ist. Somit hatte ich die Hoffnung das dies reicht.
Ich habe gerade eben den Fehler auch mal einfach ChatGPT vorgeworfen und da kam eine recht interessante Antwort zurück:
Die SetAccessor-Funktion in v8 hat sich mit Node.js 22 stark geändert.
nan versucht, einen alten Funktionsaufruf zu verwenden, der in Node 22 nicht mehr kompatibel ist.
Konkret: v8::ObjectTemplate::SetAccessor akzeptiert jetzt kein v8::AccessControl mehr; nur noch PropertyAttribute und SideEffectType.Ich bin daher verblüft, dass dies bei Dir unter Node22 läuft. Ich suche morgen mal weiter .... Danke für deine Hilfe, hab ein tollen Abend
-
node-gyp rebuild war doch von Dir.
Das wüsste ich aber...
iob upgrade iobroker.i2c@AKTUELLE_VERSION
war von mir
-
@thomas-braun Schau dir mal den 2ten Eintrag in dem Thread an. Da hattest du folgendes
iobroker add i2c auto --host chet --debug NPM version: 11.6.0Installing iobroker.i2c@1.2.1... (System call) > node-gyp rebuild
Aber ist eigentlich auch egal, ich habe den Adapter vor dem node-gyp rebuild mit deinem Befehl installiert:
iob upgrade iobroker.i2c@1.2.1
Hat aber nicht funktioniert. Ich finde es eher interessanter, dass dies bei Dir funktioniert. Ich mache auf jeden Fall mal ein Issue im GitHub für den Adapter auf, ich glaube zwar nicht, dass da was passiert, der ist ja schon länger nicht mehr gepflegt worden. Ich suche weiter.
-
Jaaaaaaaaaa, das ist aber die Konsolenausgabe von der Eingabe auf meinem System.
Das ist kein Kommando, das du verwendest. -
@hschief sagte in Error i2c adapter after upgrade of node.js version 22:
Hat aber nicht funktioniert.
Meldungen?
-
@thomas-braun Ich führe den nochmals aus und kann das gerne hier posten, was aber der normal install output, mittlerweile gibt es dazu aber im Github auch ein offenen Issue von 2 weiteren Usern die den gleichen Fehler haben.
Ich bleib dran, Danke für deine Rückmeldung. -
Du meinst den:
https://github.com/UncleSamSwiss/ioBroker.i2c/issues/840
Der eine hantiert da (warum auch immer, wird nirgendwo empfohlen...) mit
n
herum. Wer weiß was dabei herumkommt.
Der iobroker verwendet auf Debian-basierten Systemen immer die von nodesource gepackte Version. -
@thomas-braun sagte in Error i2c adapter after upgrade of node.js version 22:
Du meinst den:
ist der überhaupt noch aktiv?
last changes >4 Jahre@mcm1957 ?
-
Hier wird der Adapter inkl. aller Deps sauber gebaut:
$ iobroker add i2c auto --host chet --debug NPM version: 11.6.0 Installing iobroker.i2c@1.2.1... (System call) > i2c-bus@5.2.3 install> node-gyp rebuild gyp info it worked if it ends with okgyp info using node-gyp@11.2.0 gyp info using node@24.9.0 | linux | arm64 gyp info find Python using Python version 3.13.5 found at "/usr/bin/python3" gyp info spawn /usr/bin/python3 gyp info spawn args [gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',gyp info spawn args 'binding.gyp',gyp info spawn args '-f',gyp info spawn args 'make',gyp info spawn args '-I',gyp info spawn args '/opt/iobroker/node_modules/i2c-bus/build/config.gypi',gyp info spawn args '-I', gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',gyp info spawn args '-I',gyp info spawn args '/home/iobroker/.cache/node-gyp/24.9.0/include/node/common.gypi',gyp info spawn args '-Dlibrary=shared_library',gyp info spawn args '-Dvisibility=default',gyp info spawn args '-Dnode_root_dir=/home/iobroker/.cache/node-gyp/24.9.0',gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',gyp info spawn args '-Dnode_lib_file=/home/iobroker/.cache/node-gyp/24.9.0/<(target_arch)/node.lib',gyp info spawn args '-Dmodule_root_dir=/opt/iobroker/node_modules/i2c-bus',gyp info spawn args '-Dnode_engine=v8',gyp info spawn args '--depth=.',gyp info spawn args '--no-parallel',gyp info spawn args '--generator-output',gyp info spawn args 'build',gyp info spawn args '-Goutput_dir=.'gyp info spawn args ] gyp info spawn makegyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] make: Entering directory '/opt/iobroker/node_modules/i2c-bus/build' CXX(target) Release/obj.target/i2c/src/i2c.o SOLINK_MODULE(target) Release/obj.target/i2c.node COPY Release/i2c.node make: Leaving directory '/opt/iobroker/node_modules/i2c-bus/build' gyp info ok added 14 packages in 25s 245 packages are looking for funding run `npm fund` for details host.chet install adapter i2c upload [4] i2c.admin /opt/iobroker/node_modules/iobroker.i2c/admin/build/index.css build/index.css text/css upload [3] i2c.admin /opt/iobroker/node_modules/iobroker.i2c/admin/build/index.js build/index.js application/javascript upload [2] i2c.admin /opt/iobroker/node_modules/iobroker.i2c/admin/i2c.png i2c.png image/png upload [1] i2c.admin /opt/iobroker/node_modules/iobroker.i2c/admin/index_m.html index_m.html text/html upload [0] i2c.admin /opt/iobroker/node_modules/iobroker.i2c/admin/style.css style.css text/css host.chet object system.adapter.i2c created/updated Updating objects from io-package.json for adapter "i2c" with version "1.2.1" host.chet create instance i2c host.chet object system.adapter.i2c.0.alive created host.chet object system.adapter.i2c.0.connected created host.chet object system.adapter.i2c.0.compactMode created host.chet object system.adapter.i2c.0.cpu created host.chet object system.adapter.i2c.0.cputime created host.chet object system.adapter.i2c.0.memHeapUsed created host.chet object system.adapter.i2c.0.memHeapTotal created host.chet object system.adapter.i2c.0.memRss created host.chet object system.adapter.i2c.0.uptime created host.chet object system.adapter.i2c.0.inputCount created host.chet object system.adapter.i2c.0.outputCount created host.chet object system.adapter.i2c.0.eventLoopLag created host.chet object system.adapter.i2c.0.sigKill created host.chet object system.adapter.i2c.0.logLevel created host.chet object system.adapter.i2c.0 created Process exited with code 0
-
@homoran said in Error i2c adapter after upgrade of node.js version 22:
@thomas-braun sagte in Error i2c adapter after upgrade of node.js version 22:
Du meinst den:
ist der überhaupt noch aktiv?
last changes >4 Jahre@mcm1957 ?
EDIT:
Kommentar grundlegend geändert da eine Stellungname des Devs bereits existiert:Siehe Info von @UncleSam hier:
https://github.com/UncleSamSwiss/ioBroker.i2c/issues/841#issuecomment-3288275774 -
Ich hab jetzt extra auch nochmal einen rebuild bedingt durch einen Wechsel von nodejs ausgelöst:
2025-10-06 12:10:24.232 - error: host.chet Caught by controller[0]: Error: The module '/opt/iobroker/node_modules/i2c-bus/build/Release/i2c.node' 2025-10-06 12:10:24.233 - error: host.chet Caught by controller[0]: was compiled against a different Node.js version using 2025-10-06 12:10:24.234 - error: host.chet Caught by controller[0]: NODE_MODULE_VERSION 137. This version of Node.js requires 2025-10-06 12:10:24.235 - error: host.chet Caught by controller[0]: NODE_MODULE_VERSION 127. Please try re-compiling or re-installing 2025-10-06 12:10:24.235 - error: host.chet Caught by controller[0]: the module (for instance, using `npm rebuild` or `npm install`). 2025-10-06 12:10:24.236 - error: host.chet Caught by controller[0]: at Object..node (node:internal/modules/cjs/loader:1865:18) 2025-10-06 12:10:24.238 - error: host.chet Caught by controller[0]: at Module.load (node:internal/modules/cjs/loader:1441:32) 2025-10-06 12:10:24.239 - error: host.chet Caught by controller[0]: at Function._load (node:internal/modules/cjs/loader:1263:12) 2025-10-06 12:10:24.239 - error: host.chet Caught by controller[0]: at TracingChannel.traceSync (node:diagnostics_channel:322:14) 2025-10-06 12:10:24.240 - error: host.chet Caught by controller[0]: at wrapModuleLoad (node:internal/modules/cjs/loader:237:24) 2025-10-06 12:10:24.240 - error: host.chet Caught by controller[0]: at Module.require (node:internal/modules/cjs/loader:1463:12) 2025-10-06 12:10:24.241 - error: host.chet Caught by controller[0]: at require (node:internal/modules/helpers:147:16) 2025-10-06 12:10:24.241 - error: host.chet Caught by controller[0]: at bindings (/opt/iobroker/node_modules/bindings/bindings.js:112:48) 2025-10-06 12:10:24.242 - error: host.chet Caught by controller[0]: at Object.<anonymous> (/opt/iobroker/node_modules/i2c-bus/i2c-bus.js:4:32) 2025-10-06 12:10:24.242 - error: host.chet Caught by controller[0]: at Module._compile (node:internal/modules/cjs/loader:1706:14) { 2025-10-06 12:10:24.243 - error: host.chet Caught by controller[0]: code: 'ERR_DLOPEN_FAILED' 2025-10-06 12:10:24.244 - error: host.chet Caught by controller[0]: } 2025-10-06 12:10:24.244 - error: host.chet Caught by controller[0]: Node.js v22.20.0 2025-10-06 12:10:24.244 - error: host.chet instance system.adapter.i2c.0 terminated with code 1 (JS_CONTROLLER_STOPPED) 2025-10-06 12:10:24.246 - warn: host.chet adapter "i2c" seems to be installed for a different version of Node.js. Trying to rebuild it... 1 attempt 2025-10-06 12:10:26.700 - info: ws.0 (286400) starting. Version 3.0.19 in /opt/iobroker/node_modules/iobroker.ws, node: v22.20.0, js-controller: 7.0.7 2025-10-06 12:10:26.790 - info: ws.0 (286400) socket.io server listening on port 8084 2025-10-06 12:10:38.213 - info: weather-warnings.0 (286381) Refresh Interval: 15 minutes 2025-10-06 12:10:38.285 - info: weather-warnings.0 (286381) [whatsapp] Create notification service whatsapp adapter: whatsapp-cmb.0. 2025-10-06 12:10:38.361 - info: weather-warnings.0 (286381) [alexa2] Create notification service alexa2 state: alexa2.0.Echo-Devices.f11bc24f45914615a92ba00dcb 4ba9d5.Commands.speak. 2025-10-06 12:10:38.367 - info: weather-warnings.0 (286381) UWZ activated. Retrieve data. 2025-10-06 12:10:40.351 - info: tankerkoenig.0 (286299) Start first request 2025-10-06 12:11:12.820 - warn: host.chet instance system.adapter.parcel.0 terminated due to SIGSEGV 2025-10-06 12:11:53.176 - error: parcel.0 (287134) Error: getaddrinfo ENOTFOUND www.dpd.com 2025-10-06 12:12:00.463 - info: i2c.0 (287178) starting. Version 1.2.1 in /opt/iobroker/node_modules/iobroker.i2c, node: v22.20.0, js-controller: 7.0.7 2025-10-06 12:12:00.575 - info: i2c.0 (287178) Using bus number: 1
Läuft