Uninstall node js

Hi, I need to uninstall node js as it was installed incorrectly. Does anyone have a simple way of doing this in Ubuntu based Linux (Linux lite). I tried manually deleting the node modules but I have to go through each module individually to do this as they are write protected. Now I have a partially uninstalled version of node js :frowning:

you can try this

1 Like

Hi,

If you installed Node via apt, sudo apt remove nodejs should do. If you also want to remove configuration files: sudo apt purge nodejs. And if you want to also remove unused packages installed by Node: sudo apt autoremove.

If this doesn’t work, I’m afraid it’s going to take a deep Google search. You can also try, if the previous solution doesn’t work for you, to find its installation path (whereis node) and, from there, remove the whole directory with rm - rf.

2 Likes

Thanks, I’ll give these options a go tonight

1 Like