File path character limit error in Windows and Node App

本秂侑毒 提交于 2019-12-08 20:15:35

问题


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:


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.




回答2:


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



来源:https://stackoverflow.com/questions/23351294/file-path-character-limit-error-in-windows-and-node-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!