npm remove global code example
Example 1: uninstall webpack globally
npm uninstall -g webpack
npm uninstall webpack
Example 2: uninstall nodemon globally
npm uninstall nodemon
Example 3: how to uninstall npm package
npm uninstall -g <module_name> //to uninstall globally
Example 4: remove all packages npm
npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm