Installed directory structure is too long. Causes problems on Windows and can't be used with TFS source control #85

deadlydog opened this Issue Nov 4, 2013 · 8 comments


None yet

6 participants


The directory structure of grunt-bower-task when installed is too long. Using "npm install", the path of the longest file, excluding the project directory that it would reside in, is 230 characters:


Windows has a stupid restriction that affects TFS where a path can have a max length of 260 characters (, so this only leaves 30 characters for the path that the project will reside in.

Because we work on enterprise applications, we are required to have ALL dependencies checked into source control; we can't be installing them from the internet at build time on the build server. Effectively this means that we can't use grunt-bower-task in production until this issue is fixed.

Since the 260 character limit is a Windows (FAT and NTFS file system) problem, I assume it affects other source control repositories on Windows, but I haven't confirmed that. I expect that many other people using Windows have this same problem.

If you want to see how long all of the file paths are, you can use the Path Length Checker tool at

I notice that there are many "node_modules" directories; perhaps just shortening those to "n_m" is an easy solution; it would shave 54 characters off of your paths.


Just an FYI that I've opened the following Stack Overflow question to find a work around until this can get fixed.


The node_modules directory is managed (and named) by npm, not grunt or this task. It can't be changed. The (seemingly) recursive nesting of node_modules directories is necessary to provide localized versions of duplicate modules.


Hey @jasonkarns thanks for clarifying that this is not a grunt problem and for posting a work around on the stack overflow link. For now we've got it working using symbolic links, but if I try your workaround out I'll be sure to post my results on the StackOverflow link. Thanks again.

@deadlydog deadlydog closed this Dec 31, 2013

Glad you got something working!

zetlen commented Oct 12, 2014

I know you found a workaround, but since you've had this issue before I wanted you to know that I've created a tool called fenestrate which you can use to programmatically flatten the directory structure of your modules after installation. You can install it as a global npm postinstall hook.


anyone used “Long Path Tool”
This tool is great


Try to long path tool. It is very helpful.

Streder commented Feb 12, 2016

The Long Path Tool is not free however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment