I had the same problem. Apparently the step "Remove old version of Node-RED" removes the node and npm commands from the installed nodejs, even if you are asking it to use an existing installed one (i.e. it damages an existing nodejs install -- oops).
Easy to fix if you know where everything is. Just re-symlink node and npm from where they are installed (for me it is /usr/local/lib/nodejs/node-vXX.XX.X-linux-armv7l/bin) to where they are supposed to be in the command path (for me it is /usr/local/bin) and then start Node-RED.
I think it is the version of JavaScript you have. You should use v16 or v14. If you add --help At the end of the curl command and it will show you the exact syntax to install javascript v14 or v16.