Delete node_modules dir in Windows
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
Tell me how it goes :)
4 thoughts on “Delete node_modules dir in Windows”
December 5, 2016 at 10:59
You can also use 7Zip file manager – just be sure to use shift+del – so that directory would not be moved to Recycle Bin.
July 16, 2017 at 15:10
I will suggest “Long Path Tool” program that fixes path or file name too long issues with simplicity.
August 26, 2017 at 10:52
I would suggest to try “Long Path Tool” program.
June 17, 2018 at 23:38
Thank’s a lot!!