NEWS
[How-to] Node.js für ioBroker richtig updaten
-
@stephan2k Der Thread hier geht eigentlich um nodejs update ... js.controller Update ist formal hier fehlt am Platze ...
-
für alle Interessierten. Habe gerade auf meiner Testinstanz ein NodeJS Update von 10.17.0 auf 12.20.0 gemacht und mir dafür einn Shell Skript geschrieben
-
@Kuddel
Ja, und wo ist die Vereinfachung?
Änder einfach ein Zeichen in der /etc/apt/sources.list.d/nodesource.list und du bist da. Oder schreib direkt die passende neue Zeile per tee da rein. -
@Thomas-Braun oh so einfach
okay, dann ist mein Skript überflüssig ^^
-
Hier hab ich mal erklärt, wie das imho am besten und schnellsten und saubersten zu handeln ist:
https://forum.iobroker.net/topic/35090/howto-nodejs-installation-und-upgrades-unter-debian
Das könnte man natürlich auch in ein skript packen. Aber so wenige und unregelmäßig vorkommende Dinge muss man meiner Meinung nach nicht skripten.
Einmal das passende Repo anlegen und dann hat man da ja bis zum nächsten Release-Wechsel Ruhe. Und ob ich mich beim Wechsel auf eine weitere node-Version dann an ein herumliegendes shell-skript erinner wage ich auch mal zu bezweifeln.
-
-
@Diginix
Das ist ggf. bei Wechseln der node-Version erforderlich, dann muss das modul gegen die neue Version gebaut werden. In den meisten Fällen macht der js-controller das aber selbstständig, wenn der Bedarf erkannt wurde.Mit direktem hantieren mit npm im Verzeichnis /opt/iobroker wäre ich aber vorsichtig, besser mit dem wrapper iobroker da ran gehen:
iobroker rebuild <adapter>|self [--install]
-
Hallo , habe auf meinen Master und Slave das Update auf Node 12.20.2 gemacht. Master läuft alles , aber auf dem Slave kommt der Smartmeter Adapter nicht hoch. Siehe Meldung aus dem Log:
host.iobroker-slave 2021-02-20 10:53:52.948 info Rebuild for adapter system.adapter.smartmeter.0 not successful in 3 tries. Adapter will not be restarted again. Please execute "npm install --production" in adapter directory manually. host.iobroker-slave 2021-02-20 10:53:52.948 error instance system.adapter.smartmeter.0 terminated with code 1 (JS_CONTROLLER_STOPPED) host.iobroker-slave 2021-02-20 10:53:52.946 error Caught by controller[0]: at Module.load (internal/modules/cjs/loader.js:863:32) host.iobroker-slave 2021-02-20 10:53:52.946 error Caught by controller[0]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) host.iobroker-slave 2021-02-20 10:53:52.945 error Caught by controller[0]: at Module._compile (internal/modules/cjs/loader.js:999:30) host.iobroker-slave 2021-02-20 10:53:52.944 error Caught by controller[0]: at Object.<anonymous> (/opt/iobroker/node_modules/@serialport/bindings/lib/linux.js:2:36) host.iobroker-slave 2021-02-20 10:53:52.943 error Caught by controller[0]: at bindings (/opt/iobroker/node_modules/@serialport/bindings/node_modules/bindings/bindings.js:112:48) host.iobroker-slave 2021-02-20 10:53:52.942 error Caught by controller[0]: at require (internal/modules/cjs/helpers.js:74:18) host.iobroker-slave 2021-02-20 10:53:52.941 error Caught by controller[0]: at Module.require (internal/modules/cjs/loader.js:887:19) host.iobroker-slave 2021-02-20 10:53:52.940 error Caught by controller[0]: at Function.Module._load (internal/modules/cjs/loader.js:708:14) host.iobroker-slave 2021-02-20 10:53:52.939 error Caught by controller[0]: at Module.load (internal/modules/cjs/loader.js:863:32) host.iobroker-slave 2021-02-20 10:53:52.939 error Caught by controller[0]: at Object.Module._extensions..node (internal/modules/cjs/loader.js:1057:18) host.iobroker-slave 2021-02-20 10:53:52.938 error Caught by controller[0]: the module (for instance, using `npm rebuild` or `npm install`). host.iobroker-slave 2021-02-20 10:53:52.937 error Caught by controller[0]: NODE_MODULE_VERSION 72. Please try re-compiling or re-installing host.iobroker-slave 2021-02-20 10:53:52.936 error Caught by controller[0]: NODE_MODULE_VERSION 64. This version of Node.js requires host.iobroker-slave 2021-02-20 10:53:52.935 error Caught by controller[0]: was compiled against a different Node.js version using host.iobroker-slave 2021-02-20 10:53:52.934 error Caught by controller[0]: Error: The module '/opt/iobroker/node_modules/@serialport/bindings/build/Release/bindings.node' host.iobroker-slave 2021-02-20 10:53:52.933 error Caught by controller[0]: ^ host.iobroker-slave 2021-02-20 10:53:52.932 error Caught by controller[0]: throw e; host.iobroker-slave 2021-02-20 10:53:52.930 error Caught by controller[0]: /opt/iobroker/node_modules/@serialport/bindings/node_modules/bindings/bindings.js:121 host.iobroker-slave 2021-02-20 10:53:49.275 info instance system.adapter.smartmeter.0 started with pid 628
Was kann ich tun ? -
@mymeyer Bitte LogFiles in CodeTags setzen
-
Please execute "npm install --production" in adapter directory manually.
-
@thomas-braun sagte in [How-to] Node.js für ioBroker richtig updaten:
Please execute "npm install --production" in adapter directory manually.
Direkt auf dem Slave im Adapter Verzeichnis oder reicht /opt/iobroker ?
Oder gesagt das habe ich bereist auf dem Slave gemacht.
pi@iobroker-slave:~ $ cd /opt/iobroker/ pi@iobroker-slave:/opt/iobroker $ npm install --production npm ERR! code ENOTDIR npm ERR! syscall open npm ERR! path /opt/iobroker/node_modules/iobroker.js-controller/node_modules/ms/npm-shrinkwrap.json npm ERR! errno -20 npm ERR! ENOTDIR: not a directory, open '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/ms/npm-shrinkwrap.json' npm ERR! A complete log of this run can be found in: npm ERR! /home/iobroker/.npm/_logs/2021-02-20T09_53_20_943Z-debug.log
-
@mymeyer Im Verzeichnis des angemeckerten Moduls.
-
@thomas-braun sagte in [How-to] Node.js für ioBroker richtig updaten:
@mymeyer Im Verzeichnis des angemeckerten Moduls.
Jetzt kommt das raus:-(
pi@iobroker-slave:/opt/iobroker $ cd node_modules/iobroker.js-controller/ pi@iobroker-slave:/opt/iobroker/node_modules/iobroker.js-controller $ pwd /opt/iobroker/node_modules/iobroker.js-controller pi@iobroker-slave:/opt/iobroker/node_modules/iobroker.js-controller $ npm install --production > iobroker.js-controller@3.1.6 preinstall /opt/iobroker/node_modules/iobroker.js-controller > node lib/preinstallCheck.js NPM version: 6.14.11 npm WARN deprecated istanbul@0.4.5: This module is no longer maintained, try this instead: npm WARN deprecated npm i nyc npm WARN deprecated Visit https://istanbul.js.org/integrations for other alternatives. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797) npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated > unix-dgram@2.0.3 install /opt/iobroker/node_modules/iobroker.js-controller/node_modules/unix-dgram > node-gyp rebuild make: Entering directory '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/unix-dgram/build' CXX(target) Release/obj.target/unix_dgram/src/unix_dgram.o In file included from ../../nan/nan.h:56, from ../src/unix_dgram.cc:5: /home/iobroker/.cache/node-gyp/12.20.2/include/node/node.h:737:43: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>)' to node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type] (node::addon_register_func) (regfunc), \ ^ /home/iobroker/.cache/node-gyp/12.20.2/include/node/node.h:771:3: note: in expansion of macro 'NODE_MODULE_X' NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) ^~~~~~~~~~~~~ ../src/unix_dgram.cc:404:1: note: in expansion of macro 'NODE_MODULE' NODE_MODULE(unix_dgram, Initialize) ^~~~~~~~~~~ SOLINK_MODULE(target) Release/obj.target/unix_dgram.node COPY Release/unix_dgram.node make: Leaving directory '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/unix-dgram/build' > ursa-optional@0.9.10 install /opt/iobroker/node_modules/iobroker.js-controller/node_modules/ursa-optional > node rebuild.js ursaNative bindings compilation fail. This is not an issue. Modules that depend on it will use fallbacks. > diskusage@1.1.3 install /opt/iobroker/node_modules/iobroker.js-controller/node_modules/diskusage > node-gyp rebuild make: Entering directory '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/diskusage/build' CXX(target) Release/obj.target/diskusage/src/main.o In file included from ../../nan/nan.h:56, from ../src/main.cpp:3: /home/iobroker/.cache/node-gyp/12.20.2/include/node/node.h:737:43: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>)' to node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type] (node::addon_register_func) (regfunc), \ ^ /home/iobroker/.cache/node-gyp/12.20.2/include/node/node.h:771:3: note: in expansion of macro 'NODE_MODULE_X' NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) ^~~~~~~~~~~~~ ../src/main.cpp:42:1: note: in expansion of macro 'NODE_MODULE' NODE_MODULE(diskusage, Init) ^~~~~~~~~~~ CXX(target) Release/obj.target/diskusage/src/diskusage_posix.o SOLINK_MODULE(target) Release/obj.target/diskusage.node COPY Release/diskusage.node make: Leaving directory '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/diskusage/build' > acme-v2@1.8.6 postinstall /opt/iobroker/node_modules/iobroker.js-controller/node_modules/acme-v2 > node scripts/postinstall Greenlock and ACME.js v3 are on the way! Watch for updates at https://indiegogo.com/at/greenlock > iobroker.js-controller@3.1.6 install /opt/iobroker/node_modules/iobroker.js-controller > node iobroker.js setup first internal/modules/cjs/loader.js:818 throw err; ^ Error: Cannot find module './_copyObject' Require stack: - /opt/iobroker/node_modules/iobroker.js-controller/node_modules/y18n/index.js - /opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/build/lib/yargs.js - /opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/yargs.js - /opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/index.js - /opt/iobroker/node_modules/iobroker.js-controller/lib/setup.js - /opt/iobroker/node_modules/iobroker.js-controller/iobroker.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15) at Function.Module._load (internal/modules/cjs/loader.js:667:27) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/y18n/index.js:1:18) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/y18n/index.js', '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/build/lib/yargs.js', '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/yargs.js', '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/index.js', '/opt/iobroker/node_modules/iobroker.js-controller/lib/setup.js', '/opt/iobroker/node_modules/iobroker.js-controller/iobroker.js' ] } npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! iobroker.js-controller@3.1.6 install: `node iobroker.js setup first` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the iobroker.js-controller@3.1.6 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/iobroker/.npm/_logs/2021-02-20T11_07_58_610Z-debug.log pi@iobroker-slave:/opt/iobroker/node_modules/iobroker.js-controller $
-
-
@thomas-braun sagte in [How-to] Node.js für ioBroker richtig updaten:
Versuch mal das
cd /opt/iobroker/node_modules/@serialport npm install --production
pi@iobroker-slave:/opt/iobroker/node_modules/iobroker.js-controller $ cd /opt/iobroker/node_modules/@serialport pi@iobroker-slave:/opt/iobroker/node_modules/@serialport $ npm install --production > iobroker.inst@2.0.3 install /opt/iobroker > node lib/checkVersions.js NPM version: 6.14.11 > iobroker.inst@2.0.3 postinstall /opt/iobroker > node lib/install.js ╭─────────────────────────────────────────────────────────╮ │ │ │ Manual installation of ioBroker is no longer supported │ │ on Linux, OSX and FreeBSD! │ │ Please refer to the documentation on how to install it! │ │ https://github.com/ioBroker/ioBroker/wiki/Installation │ │ │ ╰─────────────────────────────────────────────────────────╯ npm ERR! code ELIFECYCLE npm ERR! errno 100 npm ERR! iobroker.inst@2.0.3 postinstall: `node lib/install.js` npm ERR! Exit status 100 npm ERR! npm ERR! Failed at the iobroker.inst@2.0.3 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/iobroker/.npm/_logs/2021-02-20T11_26_12_890Z-debug.log pi@iobroker-slave:/opt/iobroker/node_modules/@serialport $
Und nun ?
-
@mymeyer
Mach mal den cache leercd /optI/iobroker npm cache clear --force
Dann installier dien smartmeter-Adapter nochmal neu.
-
@thomas-braun sagte in [How-to] Node.js für ioBroker richtig updaten:
@mymeyer
Mach mal den cache leercd /optI/iobroker npm cache clear --force
Dann installier dien smartmeter-Adapter nochmal neu.
Gemacht aber er läßt sich unten dem Master nicht löschen und somit auch nicht neu installieren.
Das kommt dabei raus:Done with error: internal/modules/cjs/loader.js:818 throw err; ^Error: Cannot find module './_copyObject'Require stack:- /opt/iobroker/node_modules/iobroker.js-controller/node_modules/y18n/index.js- /opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/build/lib/yargs.js- /opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/yargs.js- /opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/index.js- /opt/iobroker/node_modules/iobroker.js-controller/lib/setup.js- /opt/iobroker/node_modules/iobroker.js-controller/iobroker.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15) at Function.Module._load (internal/modules/cjs/loader.js:667:27) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/y18n/index.js:1:18) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/y18n/index.js', '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/build/lib/yargs.js', '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/yargs.js', '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/index.js', '/opt/iobroker/node_modules/iobroker.js-controller/lib/setup.js', '/opt/iobroker/node_modules/iobroker.js-controller/iobroker.js' ]}
Dann habe ich ihn auf dem Master per "./iobroker del smartmeter.0" gelöscht. Aber in der Web Übersicht steht er immer noch. Und der Slave läuft ja noch nicht korrekt. Laut Iobroker status:
pi@iobroker-slave:/opt/iobroker $ iobroker status internal/modules/cjs/loader.js:818 throw err; ^ Error: Cannot find module './_copyObject' Require stack: - /opt/iobroker/node_modules/iobroker.js-controller/node_modules/y18n/index.js - /opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/build/lib/yargs.js - /opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/yargs.js - /opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/index.js - /opt/iobroker/node_modules/iobroker.js-controller/lib/setup.js - /opt/iobroker/node_modules/iobroker.js-controller/iobroker.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15) at Function.Module._load (internal/modules/cjs/loader.js:667:27) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object.<anonymous> (/opt/iobroker/node_modules/iobroker.js-controller/node_modules/y18n/index.js:1:18) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/y18n/index.js', '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/build/lib/yargs.js', '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/yargs.js', '/opt/iobroker/node_modules/iobroker.js-controller/node_modules/yargs/index.js', '/opt/iobroker/node_modules/iobroker.js-controller/lib/setup.js', '/opt/iobroker/node_modules/iobroker.js-controller/iobroker.js' ] } pi@iobroker-slave:/opt/iobroker $
Interesse an einer TeamViever Session ?
-
@mymeyer sagte in [How-to] Node.js für ioBroker richtig updaten:
Interesse an einer TeamViever Session ?
Nein.
-
@thomas-braun sagte in [How-to] Node.js für ioBroker richtig updaten:
@mymeyer sagte in [How-to] Node.js für ioBroker richtig updaten:
Interesse an einer TeamViever Session ?
Nein.
Und nun ... ?
-
@thomas-braun Hmm...also nachdem ich "npm install iobroker.js-controller@3.1.6 --production" gemacht habe, läuft der Slave wieder . Zumindest sagt es der Status und der Adapter läßt sich verbinden "grün" . Hmm... komisch. Bevor ich npm install gemacht hatte, habe ich noch das Verzeichnis /node_modules komplett gelöscht.
Der Smartmeter überträgt Daten und es sind keine Fehler im Log.
Ich würde sagen mit dem JS-controller 3.2.16 lasse ich mir jetzt noch etwas Zeit