Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
deadlydog opened this issue Nov 4, 2013 · 8 comments

Comments

@deadlydog
Copy link

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:

"\node_modules\grunt-bower-task\node_modules\bower\node_modules\update-notifier\node_modules\request\node_modules\form-data\node_modules\combined-stream\node_modules\delayed-stream\test\integration\test-delayed-stream-auto-pause.js"

Windows has a stupid restriction that affects TFS where a path can have a max length of 260 characters (http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx), 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 https://pathlengthchecker.codeplex.com/releases/view/82070.

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.

@deadlydog
Copy link
Author

Just an FYI that I've opened the following Stack Overflow question to find a work around until this can get fixed. http://stackoverflow.com/questions/19795171/how-to-make-grunt-deploy-use-global-npm-modules-instead-of-local-ones/
Thanks.

@jasonkarns
Copy link

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.

@deadlydog
Copy link
Author

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.

@jasonkarns
Copy link

Glad you got something working!

@zetlen
Copy link

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.

@oTnarP
Copy link

oTnarP commented Jul 15, 2015

anyone used “Long Path Tool”
This tool is great
Thanks

@Damienbarifon
Copy link

Try to long path tool. It is very helpful.

@Streder
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@jasonkarns @deadlydog @zetlen @Streder @oTnarP @Damienbarifon and others