# Uninstall and install node-red

**URL:** https://discourse.nodered.org/t/uninstall-and-install-node-red/19357
**Category:** General
**Created:** [19 December 2019 18:18 UTC](https://discourse.nodered.org/t/uninstall-and-install-node-red/19357 "2019-12-19T18:18:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![NooBAsTiK](https://avatars.discourse-cdn.com/v4/letter/n/67e7ee/32.png) [@NooBAsTiK](https://discourse.nodered.org/u/NooBAsTiK)
#### Post date: [19 December 2019 18:18 UTC](https://discourse.nodered.org/t/uninstall-and-install-node-red/19357/1 "2019-12-19T18:18:04Z")

</div>

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](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

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [19 December 2019 18:48 UTC](https://discourse.nodered.org/t/uninstall-and-install-node-red/19357/2 "2019-12-19T18:48:35Z")

</div>

What is your hardware & operating system?

---

<div class="post-metadata">

### Author: ![NooBAsTiK](https://avatars.discourse-cdn.com/v4/letter/n/67e7ee/32.png) [@NooBAsTiK](https://discourse.nodered.org/u/NooBAsTiK)
#### Post date: [19 December 2019 18:50 UTC](https://discourse.nodered.org/t/uninstall-and-install-node-red/19357/3 "2019-12-19T18:50:30Z")

</div>

standart PC, Debian OS

---

<div class="post-metadata">

### Author: ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)
#### Post date: [19 December 2019 23:27 UTC](https://discourse.nodered.org/t/uninstall-and-install-node-red/19357/4 "2019-12-19T23:27:52Z")

</div>

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](https://nodered.org/docs/getting-started/raspberrypi) (I realize that it's not a raspberry pi that you are using!)

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [20 December 2019 08:01 UTC](https://discourse.nodered.org/t/uninstall-and-install-node-red/19357/5 "2019-12-20T08:01:55Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![NooBAsTiK](https://avatars.discourse-cdn.com/v4/letter/n/67e7ee/32.png) [@NooBAsTiK](https://discourse.nodered.org/u/NooBAsTiK)
#### Post date: [20 December 2019 18:03 UTC](https://discourse.nodered.org/t/uninstall-and-install-node-red/19357/6 "2019-12-20T18:03:51Z")

</div>

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.
