Upon trying to remove the node_modules directory created by npm install
:
The source file name(s) are larger than is supported by the file system. Try moving to a location which has a shorter path name, or try renaming to shorter name(s) before attempting this operation
I also tried shift + delete and still having the same issue.
Try Visual Studio Code
After trying many solution i find this one is pretty simple. just open the project in Visual code and delete it. the UI may freeze for some seconds but it will definitely works.I test using many large size node_modules folder with it
Thanks
go to your path using cmd where your node_modules folder and apply below command
You can use Git Bash to remove the folder:
example: c:\users\olefrank\projects\mynodeproject
simple just run for windows I haven't tested it for other operating systems
in fact, you can delete any folder with this.
like rm -r AnyFolderWhichIsNotDeletableFromShiftDeleteOrDelete.
just open the gitbash move to root of the folder and run this command
Hope this will help.
Thanks, Ajay Kotnala
Advance a little beat for multiple folders...
If you have a project folder with multiple 'builds' that contains 'node_module'. Like:
You want to delete all folders starts with "build"
! First install nodejs and rimraf as suggested above !
Then go to path with project and run PowerShell command
It will take a wile
Just use powershell..
Run powershell and cd to the parent folder and then:
as in: