Adapter instance does not start after upgrading nodejs from 16 to 18
MarvinMH opened this issue · 1 comments
MarvinMH commented
I've followed the advises in
https://forum.iobroker.net/topic/64032/update-nodejs-best-practise-supported-16-und-18
to upgrade to nodejs 18. I furthermore upgraded iobroker installation and all adapters. The update was successful and all adapters except echarts are running fine.
This is what happens when I start the adapter:
host.raspberrypi4-iob | 2023-08-19 16:53:20.035 | warn | adapter "echarts" seems to be installed for a different version of Node.js. Trying to rebuild it... 3 attempt |
---|---|---|---|
host.raspberrypi4-iob | 2023-08-19 16:53:20.034 | info | system.adapter.echarts.0 will be rebuilt |
host.raspberrypi4-iob | 2023-08-19 16:53:20.034 | info | Adapter system.adapter.echarts.0 needs rebuild and will be restarted afterwards. |
host.raspberrypi4-iob | 2023-08-19 16:53:20.034 | error | instance system.adapter.echarts.0 terminated with code 1 (JS_CONTROLLER_STOPPED) |
host.raspberrypi4-iob | 2023-08-19 16:53:20.034 | error | Caught by controller[0]: Node.js v18.17.1 |
host.raspberrypi4-iob | 2023-08-19 16:53:20.033 | error | Caught by controller[0]: } |
host.raspberrypi4-iob | 2023-08-19 16:53:20.033 | error | Caught by controller[0]: requireStack: [ '/opt/iobroker/node_modules/iobroker.echarts/main.js' ] |
host.raspberrypi4-iob | 2023-08-19 16:53:20.033 | error | Caught by controller[0]: code: 'MODULE_NOT_FOUND', |
host.raspberrypi4-iob | 2023-08-19 16:53:20.033 | error | Caught by controller[0]: at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) { |
host.raspberrypi4-iob | 2023-08-19 16:53:20.033 | error | Caught by controller[0]: at Module._load (node:internal/modules/cjs/loader:960:12) |
host.raspberrypi4-iob | 2023-08-19 16:53:20.033 | error | Caught by controller[0]: at Module.load (node:internal/modules/cjs/loader:1119:32) |
host.raspberrypi4-iob | 2023-08-19 16:53:20.033 | error | Caught by controller[0]: at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) |
host.raspberrypi4-iob | 2023-08-19 16:53:20.033 | error | Caught by controller[0]: at Module._compile (node:internal/modules/cjs/loader:1256:14) |
host.raspberrypi4-iob | 2023-08-19 16:53:20.032 | error | Caught by controller[0]: at Object. (/opt/iobroker/node_modules/iobroker.echarts/main.js:12:21) |
host.raspberrypi4-iob | 2023-08-19 16:53:20.032 | error | Caught by controller[0]: at require (node:internal/modules/cjs/helpers:121:18) |
host.raspberrypi4-iob | 2023-08-19 16:53:20.032 | error | Caught by controller[0]: at Module.require (node:internal/modules/cjs/loader:1143:19) |
host.raspberrypi4-iob | 2023-08-19 16:53:20.032 | error | Caught by controller[0]: at Module._load (node:internal/modules/cjs/loader:922:27) |
host.raspberrypi4-iob | 2023-08-19 16:53:20.032 | error | Caught by controller[0]: at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15) |
host.raspberrypi4-iob | 2023-08-19 16:53:20.032 | error | Caught by controller[0]: - /opt/iobroker/node_modules/iobroker.echarts/main.js |
host.raspberrypi4-iob | 2023-08-19 16:53:20.032 | error | Caught by controller[0]: Require stack: |
host.raspberrypi4-iob | 2023-08-19 16:53:20.031 | error | Caught by controller[0]: Error: Cannot find module '@iobroker/adapter-core' |
host.raspberrypi4-iob | 2023-08-19 16:53:20.031 | error | Caught by controller[0]: ^ |
host.raspberrypi4-iob | 2023-08-19 16:53:20.031 | error | Caught by controller[0]: throw err; |
host.raspberrypi4-iob | 2023-08-19 16:53:20.031 | error | Caught by controller[0]: node:internal/modules/cjs/loader:1080 |
host.raspberrypi4-iob | 2023-08-19 16:53:19.436 | info | instance system.adapter.echarts.0 started with pid 8289 |
host.raspberrypi4-iob | 2023-08-19 16:53:19.375 | info | iobroker npm-rebuild: exit 0 |
host.raspberrypi4-iob | 2023-08-19 16:53:18.363 | info | iobroker npm-rebuild: Rebuilding native modules done |
host.raspberrypi4-iob | 2023-08-19 16:53:18.362 | info | iobroker npm-rebuild: |
host.raspberrypi4-iob | 2023-08-19 16:53:18.328 | info | iobroker npm-rebuild: rebuilt dependencies successfully |
It tries to rebuild over and over again without success. I tried the following:
- uninstall adapter, reinstall
- restart pi
- run npm install --production in the adapter directory:
pi@raspberrypi4-iob:/opt/iobroker/node_modules/iobroker.echarts $ npm install --production
npm WARN config production Use `--omit=dev` instead.
added 108 packages, and audited 109 packages in 3m
7 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
pi@raspberrypi4-iob:/opt/iobroker/node_modules/iobroker.echarts $ npm install --omit=dev
up to date, audited 109 packages in 4s
7 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
pi@raspberrypi4-iob:/opt/iobroker/node_modules/iobroker.echarts $ sudo reboot
Versions:
- Adapter version: 1.5.1
- JS-Controller version: 4.0.24
- Node version: v18.17.1
- Operating system: Raspbian GNU/Linux 10 (buster)
MarvinMH commented
Solved it by myself:
npm install iobroker/adapter-core
added 1 package, and removed 2 packages in 39s
96 packages are looking for funding
run `npm fund` for details
I leave the issue open because I think that the dependency should have been installed automatically (?).