Using snap to update nodejs

While working on something else I tripped across something I hadn't seen before which is Snap and using it to update nodejs automatically and install the latest. On my test pi I ran all the commands and it seems to work fine but I am curious if this would be best practice. I only run node red and I can see where maybe nodejs increments but node red doesn't and then I get some issues I didn't have before. Curious as to what others think about auto update nodejs.
[edit]
I run webmin to keep the system updated automagically and have used that for several years with no issues.

What version has it installed?

  1. Something

Interesting, that isn't even the latest LTS version. What channel are you asking for?

I asked for channel 18 as it looked like the latest LTS, don't know much about this so it's probable I don't have it right

According to what I see 18.16.1 is the latest LTS
20.X is current

It seems you are correct, I thought 20 was an LTS, but apparently not, or not yet at least. See https://nodejs.dev/en/about/releases/

That will, as you say install nodejs 18. It will only update within version 18. So that is no different to installing via the pi install script and then using apt to keep your system up to date. That will also keep you on the latest 18.x version.

That doesn't help me like I thought

I don't think it would be a good idea to upgrade the major version of nodejs automatically. For a start, when you upgrade the major version you have to rebuild any contributed nodes that need building. The pi install/upgrade script handles that for you. Also a major upgrade may break something. Sometimes nodes are not compatible with newer versions of node-red, so you would not want that happening without warning.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.