Uninstall and install node-red

Hello everyone.
I am a beginner and faced difficulties.
I installed node-red through the:

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

Next I added an administrator account according to the instructions https://nodered.org/docs/user-guide/runtime/securing-node-red. Then I opened the line

credential Secret: "a-secret-key"

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.

translated by google

1 Like

What is your hardware & operating system?

standart PC, Debian OS

I'm not that familiar with the standard Debian install, but why are you issuing the command;

sudo npm remove pm 2g

shouldn't it be:

sudo npm uninstall node-red ?

I would think that the best way to install node-RED on Debian would be using the official install script;

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

See https://nodered.org/docs/getting-started/raspberrypi (I realize that it's not a raspberry pi that you are using!)

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.

I went through WinSCP and deleted all the node-red NPM folders and then the script started. And it seems to work. Thank you for your responsiveness.