in the settings file and everything broke. Tried to turn back but to no avail. Decided to reinstall everything, executed the following commands in the terminal:
pm2 kill
sudo npm remove pm 2g #test with :
which pm2.
But something node-red is not removed.
Question: how to remove node-red to install it again and it worked?
Thank you all for your help.
The pi script should work fine on a Debian system, though with a half installed system that is not guaranteed, try it and come back if there are issues. For future reference, if you had just deleted the settings file it would have been recreated for you.