gpt4 book ai didi

node.js - Windows 10 node-gyp 无法构建 : MSBUILD failed with exit code 1

转载 作者:搜寻专家 更新时间:2023-11-01 00:14:40 26 4
gpt4 key购买 nike

Windows 10,微软 Visual Studio 2013, Node v0.12.7, Node gyp v2.0.2

我总是在使用 node-gyp 时遇到构建错误:

Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1

同样是红色的描述:

Could not write lines to file "Release\obj\validation\validation.tlog\validation.lastbuildstate". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. 

更大的错误摘录: https://gist.github.com/nerijusgood/63e54d9c376999a044bb

据我所知,一切都运行良好,但 msbuild 无法写入长路径名。是否有针对此问题或 Windows 解决方法的补丁?

最佳答案

编辑:标题中的问题与 OP 的实际问题(此答案解决)有点不同。
对于一般的 node-gyp 或 MSBUILD 错误,请参阅其他问题。

要解决“指定的路径、文件名或两者都太长。” 问题,将 npm 更新到版本 3+This has been bothering all windows users for a while now, and the answer is to flatten your dependencies .即使在安装期间,npm@3.x 也会自动将所有依赖项扁平化到根。

关于node.js - Windows 10 node-gyp 无法构建 : MSBUILD failed with exit code 1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31817447/

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