I’m working on an app and I’m running into this error message when trying to install it on a Homey Pro 2019. When installing from the store, the usual message “… will be installed on your Homey shortly” appears, but the app never shows up on the Homey.
When trying to run the app locally (homey app run --clean) we get this error:
The message itself looks fairly self-explenatory, but I have absolutely no clue what’s triggering it. There’s no mention of it anywhere in the docs; I can’t even find it in the Homey CLI source code repositories. And if it’s actually not directly Homey related, there’s no mention of this error anywhere on the internet.
Has anyone encountered this before?
This is from the Homey in question:
Tagging @Peter_Kawa as he’s kindly helping me trying to figure this one out.
I also have a Homey Pro 2019 but never get that error when running homey app run. Are you building a JS app? Which dependencies does it use? I think it’s an issue with a dependency that requires a newer version of Node
That app.json looks normal, node-fetch should work though I’ve never used it (I use axios for my own apps). Have you installed the latest NodeJS version on your PC?
Also, AFAIK fetch is included by default on newer NodeJS versions so you can try removing the dependency as well
That means “higher than or equal to”, so it shouldn’t be an issue. Can you try to remove that engines part from your package.json anyway? I don’t think it will fix anything though. Package-lock is also not needed for the app to function, you can delete it and run npm update to generate a new one if it somehow got corrupted. As long as you don’t delete package.json, you should be fine.
To make things even more odd: Homey apps run in a different Node.js version. I can’t remember which one and can’t check because my P-o-S HP2019 refuses to come back to life (even though it’s pinging, both the CLI tool and the dev tools claim it’s offline…)
Have you tried deleting package-lock.json and creating a new one with npm update as well? I use a Pro 2019 and have developed many apps but I’ve never seen this error before.
I can’t really try the stuff quickly myself, as I don’t have a HP2019. I sent Peter_Kawa the source code and he’s been trying stuff. The odd thing he had a working version at one point but was not sure what exactly was changed in that version.
He did send me that version back and it has "compatibility": ">=12.0.0",
I will test node-fetch on my Homey Pro 2019, since I think the issue might be there in that dependency. AFAIK you can also just remove node-fetch altogether, it’s built in to recent NodeJS versions anyway
Strange, I don’t get that error (even with the engines property set and node-fetch@2.7.0 installed). Have you updated the Homey CLI to the latest version with npm i -g homey?