If you're trying to delete a folder or file and Windows keeps barking at you "Source path too long", use rimraf command line utility instead.
Sometimes you end up having large folder trees on your hard drive that NTFS simply can't delete. Web / Node.js developers happening to work on Windows are probably aware of this issue (why would a Web / Node.js developer be working on Windows is a good question and the subject of another story).
This may look like a minor issue, but really can be a show-stopper if you're trying to use Node.js apps on Windows.
Leaving aside the technical mystery of how is the OS able to create those files but cannot delete them, here's how sane people would try to solve this problem:
File Explorer - Delete
Nope. Can't do it.
File Explorer - Shift+Delete
I know. If it's too long for Recycle Bin, I'll just use Shift+Delete.
No, it doesn't work. Hmmm...
I'm a technically-literate person, so I'll use
rmdir in Command Prompt.
The insane way: access the drive from a different OS
People happening to dual-boot their computers will be able to remove the stubborn file / folder by mounting the drive in Linux. It's impractical, though, even for geeks.
What you should do
Node.js developers may be familiar with a cool little useful NPM called rimraf. Although rimraf is mostly used in Node.js application scripts, it does have a command-line utility. Which means you can install it globally like this (assuming you already have Node.js installed):
npm i -g rimraf
Then you can simply use
rimraf instead of
rmdir, like this: