When doing modern web development you will probably have to start using NPM sooner, rather than later. Not a big deal of course, since it’s a great addition to the frontend development environment.

However, most NPM packages have quite a bit of dependencies to other packages. All of these dependencies get pulled towards your system also. Still not a big problem as you want a working solution.

The problem arises when you are on a Windows environment, there are a lot of dependencies and you want to delete a project folder on your system. You will stumble across the fact that Windows has a rather low limit on how long a path can be. When all dependencies are loaded, you will probably have some paths which are too long for Windows to handle properly.

This will give you quite a bit of a problem as you can’t delete the folder(s) anymore. One way of solving this is by using PowerShell. By executing the following script you will be able to delete the NPM modules in your project.