Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File path character limit error in Windows and Node App

I'm working on a Node project in Visual Studio 2012 and have just run into the infamous 260 character file path limit error.

My questions is: is it even possible to work on a Node project of any significant size in Visual Studio/Windows? The long filepaths come from the node_modules directory which of course nests modules that have their own node_modules, which of course nests....

I thought about installing all dependencies globally but that can't be a good idea.

Any suggestions?

like image 894
keepitreal Avatar asked Apr 28 '14 21:04

keepitreal


1 Answers

For the time being, the best you can do is put your projects as close to the root as possible. The default VS project location (C:\Users{username}\Documents\Visual Studio 2013\Projects) eats up a fair bit of the MAX_PATH limit all by itself, and then there's also the default setting to create a folder for the solution and a subfolder for the project. A nifty trick is to use subst to map the project folder to a drive letter of its own - that lets you squeeze as much as possible out of the limit, and is quite sufficient for most projects of significant size.

We know about this issue, of course. Unfortunately, on our own we're limited to better diagnostics only (and even then there's only so much we can do). The proper fix hinges on cooperative efforts by many teams in MS, which is something that may well happen eventually, but it's definitely not happening soon - even if we're trying to make this happen sooner now that there is a very real user scenario where this is a major show-stopper.

like image 123
Pavel Minaev Avatar answered Oct 28 '22 06:10

Pavel Minaev