Need help with upgrade from 3.0.2 to latest in Debian

Want to upgrade Node-Red from 3.0.2 to latest. I'm running Debian. Terrified as I have zero clue. Help please. Tried according to the ND website and get the following message! No idea what that means!

Running Node-RED install for user ola_a at /home/ola_a on debian

[sudo] password for ola_a: 
Node-RED v3.x no longer supports Nodejs 16 
  
  You can force an install of node 18 or 20 by adding --node18 or --node20 to the end of the command line above.
  However doing so may break some nodes that may need re-installing manually.
  Generally it is recommended to update all nodes to their latest versions before upgrading.
  
  If you wish to stay on nodejs 16 you can update to the latest Node-RED 1.x or 2.x version by adding
  --nodered-version="1.3.7" or --nodered-version="2.2.2" to that install command. If in doubt this is the safer option.
  Please backup your installation and flows before upgrading.
  
  Note: not all embedded hardware can be updated via this method - please check before proceeding.
  
  Exiting now.

OK :slight_smile:
I asked Chatgpt and got great help with the upgrade.
It urged me to make a backup, which I did. Of course, when it comes to Linux and updates, nothing works really well! Completely Empty ND !!!

Restore from the file and is now up and running :slight_smile:

Did you run the script with --node20 on the end or did you do something else?

Here is the link for Chatgpt:

After the upgrade I checked the version and now NR is 4.0.5 and everything vorks nice :slight_smile:

Did you install nodejs using nvm? That is a bad idea, you will have problems at some point. You would have been better to use the recommended upgrade script.

OK I have problems now :frowning: Where could I find the update script?
I have v18.20.4 but when install it says that I have v16.20.2
What should I do?

For ubuntu/debian based systems: Running on Raspberry Pi : Node-RED

Sounds like you have installed nvm or n - best to remove this.

Try running the script with --node18 appended e.g

the_script_as_detailed_in_the_link --node18

I tried the script for upgrade "

sudo npm install -g --unsafe-perm node-red

But I still get the npm warning see picture.

What you ran was npm install. That is not the "update script" we are talking about. See my post above.

Also, please confirm if you are using nvm or n or some other node version manager.

Sorry I made a mistake. Now I tried your link and it looks very different and I don't get any errors so far. I try to start and then I get the same error as before se picture.

Not sure if we can make this any clearer?

Yes it seems that I used NVM.

How to remove nvm?

Like this

Or this :wink:

Sorry but I don't find anything of this files. I tried source ~/.bashrc

i don't know what I'm doing. My NR have been upp 2 years now without any problems. I remember it was big problems to install it in the beginning :frowning:

I'm really appreciates your help.

  1. what do you see if you enter which nvm
  2. what do you see if you enter echo $NVM_DIR

Not if you used the script and avoid NVM. It really is that simple.

I tried to install again and now it looks different. I et back to you son...

Now it's looking better. Yes I'm up and going :slight_smile: And all nodes are there phuuuu.
I'm so happy now an again thank you very much for all the help and for putting up with me and my ignorance.

2 Likes

By this do you mean that you have not got a backup of the flows?

You should backup everything in your .node-red folder except the node_modules folder.

If you ever have to recover from a disaster then restore that folder, go into it and run
npm install
which will restore all the extra nodes required.

No I have backup of everything but I don't like to work to much, and in the computer world not everything goes as i should even restore get me into to much work sometimes.

Anyway really thanks for all help and concern :slight_smile: