Completely remove Node-RED

I installed Node-RED using this install script and am now looking to remove it from my system:

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

How would I go about undoing everything the script did? I just got through spending several days working on my Pi setup and I'd currently like nothing more than to clean it back up until I'm ready to give this whole thing another try in the future. Thanks in advance!

By far the easiest way to get a clean Pi is to re-install your SD-Card.

Otherwise, you can do the following:

sudo npm remove -g node-red node-red-admin
rm -R ~/.node-red

You will need to hunt down the systemd startup script and delete that as well.

You could also remove node.js if you really want to though there doesn't really seem much point.

Thanks for the quick reply!
I've run each of these commands and removed the systemd startup script, however I can still issue the node-red-start and node-red-stop commands, albeit with errors. Any idea what's lingering around that'd still allow them to function?

If you ran Dave's script to install, the best thing to do will be to work backwards through the script so that you see what to uninstall. I don't use the script so I'd forgotten about the start and stop commands, they need removing too of course. :slight_smile:

The command
which node-red-start
will tell you where they are so you can delete them. Not sure of the point of all this however. Why does it matter? Especially if you are going to try again at some point.

we add those helper scripts into /usr/bin - go in there and delete anything node-red*
You can also check /usr/lib/node_modules - may be some remnants in there - If you aren't using any other nodejs app you can safely delete them as well.

If you have run it - there will also be your own ~/.node-red directory which contains any flows you have created so far. - Up to you if you want to delete them or leave them for next time.

2 Likes

I ran the following to test uninstall of node-red:

# node-red-stop
# systemctl stop nodered
# systemctl disable nodered
# npm -g remove node-red
# npm -g remove node-red-admin
# apt remove nodejs (Not used by any other solution)
# rm -rf ~/.node-red (For user node-red was under)

Then I did...

# find / | grep nodered
/etc/logrotate.d/nodered
/lib/systemd/system/nodered.service
/var/log/nodered-install.log

# rm -rf /etc/logrotate.d/nodered
# rm -rf /lib/systemd/system/nodered.service
# rm -rf /var/log/nodered-install.log

But I find references to...

# npm uninstall ...

Is there a difference?

Also, looks like neither npm uninstall or npm -g remove clean up the scripts in the /usr/bin directory, or some of the svg files.

# find / | grep node-red
/usr/bin/node-red-log
/usr/bin/node-red-restart
/usr/bin/node-red-stop
/usr/bin/node-red-reload
/usr/bin/node-red-start
/usr/share/icons/hicolor/scalable/apps/node-red-icon.svg

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.