ioBroker / ioBroker.node-red

Instantiate the server with node-red
Apache License 2.0
52 stars 27 forks source link

node-red adapter doesn't properly start after update to 4.0.0 #331

Closed Kaldesh84 closed 1 year ago

Kaldesh84 commented 1 year ago

Hi,

after updating to 4.0.0, the node-red adapter is caught in a restart loop with this error message:

node:internal/modules/cjs/loader:959 throw err; ^ Error: Cannot find module 'jsonfile/utils' Require stack: - /opt/iobroker/node_modules/node-red/node_modules/fs-extra/lib/json/output-json.js - /opt/iobroker/node_modules/node-red/node_modules/fs-extra/lib/json/index.js - /opt/iobroker/node_modules/node-red/node_modules/fs-extra/lib/index.js - /opt/iobroker/node_modules/node-red/red.js at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15) at Function.Module._load (node:internal/modules/cjs/loader:804:27) at Module.require (node:internal/modules/cjs/loader:1028:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.<anonymous> (/opt/iobroker/node_modules/node-red/node_modules/fs-extra/lib/json/output-json.js:3:23) at Module._compile (node:internal/modules/cjs/loader:1126:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10) at Module.load (node:internal/modules/cjs/loader:1004:32) at Function.Module._load (node:internal/modules/cjs/loader:839:12) at Module.require (node:internal/modules/cjs/loader:1028:19) { code: 'MODULE_NOT_FOUND', requireStack: [ '/opt/iobroker/node_modules/node-red/node_modules/fs-extra/lib/json/output-json.js', '/opt/iobroker/node_modules/node-red/node_modules/fs-extra/lib/json/index.js', '/opt/iobroker/node_modules/node-red/node_modules/fs-extra/lib/index.js', '/opt/iobroker/node_modules/node-red/red.js' ] }
--

I installed the version manually and restarted adapter, iobroker and even the host to no effect. I also can't install the lower version now, it seems npm isn't allowed to rename any folders.

$ iobroker upgrade node-red@3.3.1 --debug

Update node-red from @4.0.0 to @3.3.1

NPM version: 8.19.2

Installing iobroker.node-red@3.3.1... (System call)

npm ERR! code ENOTEMPTY

npm ERR! A complete log of this run can be found in:npm ERR! /home/iobroker/.npm/_logs/2022-09-19T13_06_43_723Z-debug-0.log

host.raspberrypi Cannot install iobroker.node-red@3.3.1: 217

ERROR: Process exited with code 25

Node.js version: 16.17.0 js-controller version: 4.0.23

Apollon77 commented 1 year ago

Hi ...strange. Somehow npm sems to have messed up your package tree.

... you can try to stop the adapter, then delete "/opt/iobroker/node_modues/iobroker.node-red" completely with all subdirs and then start adapter again. Iobroker dfetect that it is missing and try to install anything needed. Maybe that fixes it?

For the downgrade error here should be a line more then you posted where he tells you what is "existing that should not be there" ... and then pot. follow https://forum.iobroker.net/topic/57337/fehler-25-bei-adapter-install-update-mit-npm8

Kaldesh84 commented 1 year ago

Yes, I misread the error with the downgrade.

The problem was not that npm couldn't rename the folders to the temp version. The temp version with the same name was already existing. I expected that the suffix was random each time, but it's not. So npm tried using the already existing temp folder that was not cleaned up from the first 4.0.0 installation that seems to have gone completely wrong for whatever reason.

Once I deleted all of them, I tried reinstalling version 4.0.0 via the "Install specific version" option in Admin with 4.0.0 which was successful.

Thanks for your help