Upgrading node.js and node-red for AWS EC2 ubuntu

Is this the right command for Upgrading node.js and node-red for AWS EC2 ubuntu:

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

I can't find the explanation in the documentation

That may depend on how you installed it. How did you do that?
Also what does
node -v
show, and which version of node-red are you currently on?

First:
sudo apt update
sudo apt -y upgrade

To install NodeJS:
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

To update NodeJS:
sudo n stable

To install the latest release, use sudo n latest
Alternatively, you can run sudo n #.#.# to get a specific Node version.

To install/update NodeRed:
sudo npm install -g --unsafe-perm node-red