Node packages not building on Windows 8.1 - Missing Microsoft.Cpp.Default.props(未在 Windows 8.1 上构建的节点包 - 缺少 Microsoft.Cpp.Default.props)
问题描述
NPM 包未在 Windows 8.1 上构建 - 失败并出现以下错误,
NPM packages are not building on Windows 8.1 - failing with following error,
error MSB4019:未找到导入的项目C:Microsoft.Cpp.Default.props".确认 <Import> 中的路径.声明是正确的,并且该文件存在于磁盘上.
我尝试了以下方法,
- 将环境变量
VCTargetsPath设置为C:Program Files (x86)MSBuild12.0(错误相应更改,但没有Microsoft.Cpp.Default.props与 2012 构建工具). - 根据此答案 安装 VisualStudio 2010 环境(先卸载,然后按正确顺序安装)
- 完全删除了 VisualStudio 2010 并尝试使用 VisualStudio 2012,它应该根据
Node-gypwiki - 根据这个答案 添加了注册表项
- 根据这个答案 尝试使用 Windows 7.1 SDK 命令提示符
- 在根据这个答案 运行 npm 之前尝试设置
- 尝试根据这个答案将
--msvs_version=2012传递给npm>
VisualStudioVersion- Setting an evironment variable
VCTargetsPathtoC:Program Files (x86)MSBuild12.0(The error changes accordingly but there is noMicrosoft.Cpp.Default.propswith the 2012 build tools). - Installing a VisualStudio 2010 environment (uninstalled then installed in the correct order) according to this answer
- Completely removed VisualStudio 2010 and tried a VisualStudio 2012 instead, which should work according to the
Node-gypwiki - Added registry keys according to this answer
- Tried using the Windows 7.1 SDK command prompt according to this answer
- Tried setting
VisualStudioVersionbefore running npm according to this answer - Tried passing
--msvs_version=2012to npm according to this answer
以上都没有奏效.
我已经在这上面花了很长时间.有没有人有一个明确的有效答案?
I've spent ages on this already. Does anyone have a definite answer that works?
推荐答案
现在是凌晨 2.47 - 想通了.
So it is 2.47am - figured it out.
尽管 node-gyp 站点似乎建议使用 Visual Studio 2010 或 2012,但对于 Windows 8.1,请安装 适用于 Windows 桌面的 Visual Studio Express 2013,如这个问题.
Although the node-gyp site seems to suggest using Visual Studio 2010 or 2012, instead for Windows 8.1, install Visual Studio Express 2013 for Windows Desktop as discussed in this issue.
这篇关于未在 Windows 8.1 上构建的节点包 - 缺少 Microsoft.Cpp.Default.props的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:未在 Windows 8.1 上构建的节点包 - 缺少 Microsoft.C
基础教程推荐
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 我有静态或动态 boost 库吗? 2021-01-01
- 常量变量在标题中不起作用 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
