6

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?

1

2 Answers 2

5

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Couldn't agree more. I'd love to go back to windows but the MAX_PATH completely kills most large node projects.
Just wanted to point out that Colin Bowern at visualstudio.uservoice.com linked this post so I figured I'd complete the loop. This is an issue that the community has asked Microsoft to correct (Original suggestion: bit.ly/1lUi7C4) they decided to deny the first one, the community responded by posting the same suggestion with a link to the first (located here: bit.ly/1pFcTKG) and the vote count continues to climb. I'm linking it here in hopes of helping to acquire more votes so MS doesn't simply ignore it a second time. This is a ridiculous problem that they need to fix.
I've had Node projects with a folder right at root, and still gotten the MAX_PATH issue. Since the time that this answer was given, the ASP.NET team has developed a Node package that will help, 'flatten-packages.' visualstudiogallery.msdn.microsoft.com/…
0

This problem is generated by "node_modules" which contains plugins with directories too deeper. The solution is to do extract all dependencies of plugins to "node_modules". Look in how-to-deploy-node-js-application-with-deep-node-modules-structure-on-windows this answer

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.