Domanda

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?

È stato utile?

Soluzione

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.

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top