Category: javascript windows

Delete node_modules dir in Windows

Author: Luka U. October 19, 2016

You are a happy Windows user. You have just upgraded your nodejs (if you can) and now you have to delete local /node_modules directory to install brand new packages. Problems?

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters

Yes, Windows can't delete this directory because of the limitations in system. What now? Don't worry, NPM comes to the rescue.

Just install Node package rimraf.

> npm install rimraf -g

Move to direcotry above node_modules and execute.

> rimraf node_modules

4466041

Tell me how it goes :)

Author
Luka U.

    3 thoughts on “Delete node_modules dir in Windows”

  • You can also use 7Zip file manager – just be sure to use shift+del – so that directory would not be moved to Recycle Bin.

  • I will suggest “Long Path Tool” program that fixes path or file name too long issues with simplicity.

  • I would suggest to try “Long Path Tool” program.

  • Leave a Reply

    Your email address will not be published. Required fields are marked *