【发布时间】:2014-01-30 22:11:13
【问题描述】:
NPM 包未在 Windows 8.1 上构建 - 失败并出现以下错误,
error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
我已经尝试了以下,
- 将环境变量
VCTargetsPath设置为C:\Program Files (x86)\MSBuild\12.0\(错误会相应更改,但在 2012 构建工具中没有Microsoft.Cpp.Default.props)。 - 按照this answer安装VisualStudio 2010环境(卸载后按正确顺序安装)
- 完全删除 VisualStudio 2010 并尝试使用 VisualStudio 2012,它应该可以根据
Node-gypwiki 工作 - 根据this answer添加了注册表项
- 根据this answer尝试使用Windows 7.1 SDK命令提示符
- 在根据this answer运行npm之前尝试设置
VisualStudioVersion - 尝试根据this answer将
--msvs_version=2012传递给npm
以上方法均无效。
我已经为此花费了很长时间。有人有明确的答案吗?
【问题讨论】:
-
它位于 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110 目录中。由 VS2012 安装程序放在那里。 VCTargetsPath 需要指向那里。
-
我也试过了,它实际上需要最后没有
V11.0的路径,但它仍然不起作用...... -
得到了类似的东西,但在 Windows 7 上使用 VS 2013。为了解决它,我使用“VS2013 的开发人员命令提示符”运行
npm install。
标签: c++ visual-studio-2010 node.js visual-studio-2012 msbuild