Hey guys/gals :) Great system, by the way! I'm having some trouble, however, as I'm unable to move my project on my disk because Windows is saying that over 100 files within the node_modules directory structure have file names longer than 250 characters. I've isolated it to files inside of grunt-contrib-imagemin and grunt-google-cdn. Since Windows has a file name size limit of 250, is there a way you could use a shallower directory structure for these? For some reason, the scripts that made the files were able to do so, but now nothing can deal with these files. I can't zip them or copy them. If I open one of the really long ones, Windows has consolidated all the node_modules parts of the path to NODE_M~1, but that doesn't seem to help when writing the files, such as copying, etc. Any help would be much appreciated!
Oh, if this helps, here's one of the long directory paths:
That's 216, plus if you prepend it with the path where the project is living, it pops past 250. There's over 100 files in these structures with this problem, as I said above :)
Nope, this is a Windows Explorer limitation, not something npm can control. npm (and node) use filesystem methods that do not have this limitation; if you are using other software (such as Windows Explorer) that does not support long file names, the bugs need to be fixed there, and not in npm.
We were seeing this issue as well on Windows; specifically with Virtualbox shared folders. Would npm flatten help resolve this?
To move the project, delete the node_modules first and then run npm install on the new location.
However, you will not be able to delete it from explorer. I built this small powershell script that does it for you. https://gist.github.com/abergs/e682cd1f98f5170e86a6
We use that script at work.
npm -g install rimraf
will take care of removing the paths.
@tjwebb npm dedupe will help with this somewhat, but to really address it will require a more comprehensive solution. I'm closing this issue in favor of #5641, of which it is a duplicate, and which also discusses some of the issues standing in the way of resolving the underlying issues. See also the discussion on #3697.