gpt4 book ai didi

npm - VS2015 CTP6 中嵌套 node_modules 的 "FullPath cannot be applied"错误

转载 作者:行者123 更新时间:2023-12-04 11:50:43 25 4
gpt4 key购买 nike

我在 Visual Studio 2015 CTP6 中玩弄 MVC6 + Aurelia 项目,遇到了一些有趣的事情。

我的 node_modules默认情况下在项目根目录中,一切正常。但是,我想让源代码树更有条理和移动node_modules , jspm_modules以及与子文件夹相关的内容 - 例如。 MyApp\client\node_modules等等。

但现在 Visual Studio 停止加载项目。这是来自“VsProjectFault.failure.txt”的异常:

(Inner Exception #1) System.InvalidOperationException: The item metadata "%(FullPath)" cannot be applied to the path "client\node_modules\conventional-changelog\node_modules\lodash.assign\node_modules\lodash._basecreatecallback\node_modules\lodash.bind\node_modules\lodash._createwrapper\node_modules\lodash._basecreatewrapper\node_modules\". C:\Work\xxxxxxxxxx\xxxxxxxxxx.xxx\src\client\node_modules\conventional-changelog\node_modules\lodash.assign\node_modules\lodash._basecreatecallback\node_modules\lodash.bind\node_modules\lodash._createwrapper\node_modules\lodash._basecreatewrapper\node_modules\
at Microsoft.Build.Shared.ErrorUtilities.ThrowInvalidOperation(String resourceName, Object[] args)
at Microsoft.Build.Shared.ErrorUtilities.VerifyThrowInvalidOperation(Boolean condition, String resourceName, Object arg0, Object arg1, Object arg2)
at Microsoft.Build.Shared.FileUtilities.ItemSpecModifiers.GetItemSpecModifier(String currentDirectory, String itemSpec, String definingProjectEscaped, String modifier, String& fullPath)
...
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ProjectSystem.Utilities.DataflowExtensions.<>c__DisplayClass37`2.<<CreateSelfFilteringTransformBlock>b__38>d__0.MoveNext()

显然问题出在 node_modules递归路径太长 - 还有 bug #6960在节点跟踪器中

Node needs an alternative approach to endless, recursively nested node_modules folders on Windows. Most Windows tools, utilities and shells cannot handle file and folder paths longer than 260 characters at most.



...这似乎是 closed as won't fix对我来说:

Node isn't going to change, so this isn't really a Node issue. The problem is not with the module loading semantics, but with the module installation semantics. (The two are related, but not identical.)



但后来我不明白这个项目是如何加载的,因为即使 node_modules,有些路径肯定超过 260 个符号。在项目根目录下!

配置中是否有一些设置或有助于 Visual Studio 2015 加载项目的内容 node_modules , 这是怎么回事?

最佳答案

http://bstruthers.com/weblog/2013/02/06/Cannot_evaluate_the_item_metadata_FullPath/

这是因为 VS 中文件路径的字符限制已经越界。将文件夹复制到根文件夹中并尝试。

关于npm - VS2015 CTP6 中嵌套 node_modules 的 "FullPath cannot be applied"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29369932/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com