How to update Node-RED?

Hello,
I installed Node-RED on my Raspberry using:

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

Can you please advise how Node-RED is updated, shall I do that and how o is it updated automatically?

Thanks for helping,
Dan

You just re-run the script when you hear about a new release and you want to use it

1 Like

If you want to use automated updates, you can either run that script periodically. Or you can use the standard apt and npm features to update it instead, reserving the script just for major updates.

1 Like

Thanks!
Could you please advise the syntax to update it via apt and npm?

We would recommend just rerunning the script as it takes care of it all. There's no real reason to only use it for certain upgrades as you then have to decide for yourself if any particular upgrade warrants the script or running the same commands manually.

1 Like

Thanks for clarifying.
Just one question, rerunning the script will not delete any flow or setting or?

Running the script doesn't change your flows or any other local configuration.

The potential advantage of using apt/npm is if it fits in with how you update the rest of your OS. If you have no standard way of doing that then perhaps the script is enough though it doesn't also update your node modules automatically as far as I'm aware? So you probably still have to update those separately if you are using any non-core nodes.

Personally, I use unattended-upgrade on my new build as this now seems to come standard with Debian Buster and is easily installed on Rasbian Buster. There is another thread somewhere regarding that. That runs an apt update every day to keep the OS up-to-date. Previously I was using webmin on my Pi3 to do the same thing.

For Node-RED and related nodes, I update manually but the way I have things installed, that is just a single npm command for everything.

The script is the simplest way and if you aren't sure, that's surely the way to go as Nick says. Maybe use cron to run it every month? But if you want to integrate to other management/admin tasks, you might want to investigate some of the other options.