How to remove all local npm packages when you can’t remove packages because the path is to long or because of any other issue.
Open Terminal or Git Bash (which you get when you install Git for Windows), and navigate to folder from which you want to remove npm packages, and run:
for package in `ls node_modules`; do npm uninstall $package; done;
This will list all node_modules in the current directory and for each package in this list it will run npm uninstall for it.
So now you will have clean node_modules directory.