openhabian 2024-03-16T22:19:25+01:00}(b09cef5) on Raspi 3+
I ran openhabian-config to do an update. Everything was working fine. I realized a message, which asked me to update npm.
So i did a npm install -g npm@10.5.0
as requested and got the following error messages:
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: npm@10.5.0
npm ERR! notsup Not compatible with your version of node/npm: npm@10.5.0
npm ERR! notsup Required: {“node”:“^18.17.0 || >=20.5.0”}
npm ERR! notsup Actual: {“npm”:“8.19.4”,“node”:“v16.20.2”}
npm ERR! A complete log of this run can be found in:
npm ERR! /home/openhabian/.npm/_logs/2024-03-26T08_43_55_781Z-debug-0.log
Maybe my npm version is older as expected. I can’t remember to have been ask to update npm before. Hm, you never know.
While starting up “openhabian-config → 2 Upgrade System” i got the message to update as shown.
Via apt i get
Die folgenden Pakete haben unerfüllte Abhängigkeiten:
libnode72 : Kollidiert mit: nodejs-legacy
nodejs : Kollidiert mit: npm
E: Probleme können nicht korrigiert werden, Sie haben zurückgehaltene defekte Pakete.
So there seems to a problem with old npm/node.js versions.
After removing nodejs via apt, some dependencies stayed and “apt install …” still did not work (same error). So i installed nodejs manually.
After this i did another “apt install …”. No errors and everthing seems to be fine. No log errors, no strange system behaviour … up to now.
I red some stuff about problems with old versions which made me go for the manual install. Not a good idea normally. But it seemed to wok in this case.
2025-01-21_22:03:30_CET [openHABian] Checking for updates of openhab_rules_tools for JS Scripting... npm notice
npm notice New major version of npm available! 9.6.7 -> 11.0.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.0.0
npm notice Run npm install -g npm@11.0.0 to update!
npm notice
If I run …
npm install -g npm@11.0.0
… I get the same dependency problems
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: npm@11.0.0
npm ERR! notsup Not compatible with your version of node/npm: npm@11.0.0
npm ERR! notsup Required: {"node":"^20.17.0 || >=22.9.0"}
npm ERR! notsup Actual: {"npm":"9.6.7","node":"v18.17.1"}
I assume you need to update nodejs first?
In case your hardware is a Pi, I think npm is supported until npm version 10.x only, which requires nodejs v18