未在 Windows 8.1 上构建的节点包 - 缺少 Microsoft.Cpp.Default.props [英] Node packages not building on Windows 8.1 - Missing Microsoft.Cpp.Default.props

查看:28
本文介绍了未在 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-gyp wiki
  • 根据这个答案
  • 添加了注册表项
  • 根据这个答案
  • 尝试使用 Windows 7.1 SDK 命令提示符
  • 在根据这个答案
  • 运行 npm 之前尝试设置 VisualStudioVersion
  • 尝试根据这个答案--msvs_version=2012传递给npm>
  • Setting an evironment variable VCTargetsPath to C:Program Files (x86)MSBuild12.0 (The error changes accordingly but there is no Microsoft.Cpp.Default.props with 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-gyp wiki
  • Added registry keys according to this answer
  • Tried using the Windows 7.1 SDK command prompt according to this answer
  • Tried setting VisualStudioVersion before running npm according to this answer
  • Tried passing --msvs_version=2012 to 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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