Windows 和 Node App 中的文件路径字符限制错误 [英] File path character limit error in Windows and Node App

查看:30
本文介绍了Windows 和 Node App 中的文件路径字符限制错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Visual Studio 2012 中处理 Node 项目,刚刚遇到了臭名昭著的 260 个字符文件路径限制错误.

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

我的问题是:甚至可以在 Visual Studio/Windows 中处理任何重要规模的 Node 项目吗?长文件路径来自 node_modules 目录,这些目录当然嵌套了具有自己的 node_modules 的模块,这些模块当然嵌套了....

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.

有什么建议吗?

推荐答案

就目前而言,您能做的最好的事情就是让您的项目尽可能靠近根目录.默认的 VS 项目位置 (C:\Users{username}\Documents\Visual Studio 2013\Projects) 自己占用了相当多的 MAX_PATH 限制,然后还有为解决方案创建文件夹的默认设置 项目的子文件夹.一个巧妙的技巧是使用 subst 将项目文件夹映射到它自己的驱动器号 - 这让您尽可能多地挤出限制,并且对于大多数大型项目来说已经足够了.

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.

当然,我们了解这个问题.不幸的是,我们自己仅限于只有更好的诊断(即便如此,我们能做的也只有这么多).正确的修复取决于 MS 中许多团队的合作努力,这很可能最终会发生,但绝对不会很快发生 - 即使我们现在正试图尽快实现这一点,因为现在有一个非常真实的用户场景这是一场大秀.

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.

这篇关于Windows 和 Node App 中的文件路径字符限制错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆