How to uninstall npm global packages (including yourself) and nodejs?

how do I uninstall all npm global packages (including npm itself) and node.js in Windows10 and Unbuntu 16.04.2?

A search on the Internet has found a lot of commands. It seems that uninstalling npm and nodejs is not an easy task. Ask for advice.


In the case of

win, I uninstall it directly in the program management that comes with the system:
clipboard.png

of course, some other global packages need to be deleted in the installation directory.
for example, C:\ Users\ your user name\ AppData\ Roaming\ npm\ node_modules (if not, open the hidden folder. )

the above is for reference only.


found the following solution
https://blog.csdn.net/nsrainb.

it depends on how you install it. Use sudo apt-get remove nodejs to uninstall nodejs.

generally node is / usr/local/bin , npm and node_modules are / usr/local/lib .

Menu