Uninstalling Node.js from Linux using cmd

When you want to uninstall a program usually we uninstall from the UI. Lets see how to uninstall

Node.js from Linux using command prompt. Open command prompt and go to the directory then

type which node. This will return something like

/path/bin/node

. Then run

cd/path
. It is all that added by Node.js.

rm -r bin/node bin/node-waf include/node lib/node lib/pkgconfig/nodejs.pc share/man/man1/node.1

Now remove npm using sudo.

Sudo npm uninstall npm-g

Npm needs node to run so you might not be able to remove npm if you have already removed node.

So type npm uninstall npm command before removing Node.