How to uninstall node

I installed my node and need to uninstall it. I executed following and restarted node-red.

sudo npm -g uninstall {path_to_node_source}

But the palet still has that node. How to uninstall a node properly.?

I user Ctrl+C to terminate node-red. Will that be the issue?

Are you sure you intalled using the -g?
do a cd .node-red/node_modules and see if the node it there. If it is do
cd .. and sudo npm uninstall node-red-whatever-the-node-is which will remove the node.

I didn’t install it with -g. and sudo npm uninstall node-red-whatever-the-node-is didn’t work. I removed it from /node_modules folder and its not longer there. But I am afaraind that manually deleting the folder is not the correct way to do it. ?

If you didn’t install with -g you shouldn’t try to uninstall with -g. Also never use sudo to install or uninstall a non-global node (ie not -g) or you will mess up your file permissions which may give problems later.

just deleting the folder may not be the correct way to remove it as it may not remove sub-dependencies - but it works - so meh… don’t over worry about it.

had a similar issue with the node still showing as installed after npm .. uninstall with various options... went into the .node-red directory itself and ran it, then ran npm audit fix... worked, not sure which was the magic sauce.

Do you mean that the first time you were not in the .node-red directory? If so then that was the problem. Unless you are installing globally (with -g) then installs are local to the folder you run npm in.
By the way, running audit fix is generally not recommended as you can end up with incompatible versions of nodes, which can break things.

I'm pretty sure that was the situation (not being in the .node-red directory), though can't be certain, was moving in an out trying to figure why the node-red lib was still showing up as installed in the UI. Could very well have been a good old F5/refresh that was the real trick. Either way, thanks for the clarification @Colin; I'm a long time user but novice dev with npm/node.js.

how to remove from android sonoff Ian Because the command tsudo npm uninstall node-red-contrib-sonoff-lan-mode Does nothing about .node-red or .node-red/node_modules

If the node is installed in .node-red/node_modules then you need to enter the .node-red folder and run
npm uninstall node-red-sonoff-lan-mode
Note, no sudo and no -g