delete all npm code example
Example 1: delete all node module
npx npmkill
//hit space bar to confirm
Example 2: remove all packages npm
npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm
npx npmkill
//hit space bar to confirm
npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm