Fail to remove node that crashes Node Red on start

I've run into this problem, which crashes Node Red:

TypeError: Cannot read property 'heartBeat' of null
at Hub.onMessage (/Users/Admin/.node-red/node_modules/node-xiaomi-smart-home/build/Hub.js:70:16)
at Socket.emit (events.js:127:13)
at UDP.onMessage [as onmessage] (dgram.js:659:8)

I've tried using the backup flow json and also unistalling the node, but no success. What do I need to remove from my flow json or other file for the flow not to run and crash Node Red at start up?

1 Like

Am I correct to think that in the flow.json there is the tab and then the flow? If I remove everything related to the crashing node it should be a good start. But should I remove any references to config nodes somewhere? Are they in node_modules? I would be grateful for any help on this as my whole house is running on node red, i.e. is not running at the moment. Thanks

If you have uninstalled the node then it cannot cause the crash, as the file it mentions in the error will not exist.
From your .node-red folder npm uninstall the xiaomi node and post what you see in the terminal when you do that.

image1

This doesn't look right.

Why are you using sudo? I hope you have not been installing using sudo (except for globally installed nodes) or you will have files in your user folder owned by root. Also are you doing that from the .node-red folder?

No, that was a mistake. I redid it below without sudo.

You have not uninstalled the node that is giving the error. which is node-xiaomi-smart-home.
When you post logs please cut and paste so we can more easily see what is there.

Yes, sorry about posting screen dumps, I was on my mobile. Managed to uninstall now, I needed to use the name of the folder in node_modules and not the official npm package name, which I thought was how to do it. Thanks for your help.

I guess that installing node-red-contrib-xiaomi-smart-home pulled in node-xiaomi-smart-home as a dependency, but it did not get removed when you uninstalled the contrib node. I am not entirely sure how such things are supposed to work with npm.