2
votes

Following this guide, after execute the command yo webapp a folder named node_modules is created. I want to delete that folder but I can't do it neither using command line or Windows file explorer because the path is too long. How I can delete this folder?

Error message at console:

rmdir : 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.

3

3 Answers

1
votes

You can use rimraf which is the unix command rm -rf for node.:

$ rimraf <name of dir to delete>

You can install rimraf using npm:

$ npm install -g rimraf
0
votes

Specify the path using Extended Length Path syntax, e.g. \\?\C:\Path\to\an\existing.file.

Also, I successfully used Total Commander to delete a directory in a long path.

0
votes

Thanks to a newish open-source project released by Microsoft, you can easily delete paths that are too long using WinFile (which was introduced in WinXP). Sometimes you have to go "Back to the Future". This can delete paths too long on Microsoft networks share as well.

enter image description here

WinFile (compiled for Win10) available here https://github.com/Microsoft/winfile

To find many paths that are too long and automate a fix, I recommend Path Too Long Auto Fixer - a free demo is available.