未在Windows 8.1上构建的节点软件包 - 缺少Microsoft.Cpp.Default.props [英] Node packages not building on Windows 8.1 - Missing Microsoft.Cpp.Default.props
问题描述
NPM包不是在Windows 8.1上构建的 - 失败,出现以下错误:
NPM packages are not building on Windows 8.1 - failing with following error,
错误MSB4019:导入的项目C:\ Microsoft .Cpp.Default.props。确认< Import>
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
)。 - 根据此答案安装VisualStudio 2010环境(已卸载,然后以正确的顺序安装)
- 完全删除VisualStudio 2010,尝试使用VisualStudio 2012,应根据
Node-gyp
wiki - 根据此答案
- 根据 this answer
- 根据 VisualStudioVersion .com / a / 19736102/199>此回答
- 尝试通过
- msvs_version = 2012
到npm 此回答
- Setting an evironment variable
VCTargetsPath
toC:\Program Files (x86)\MSBuild\12.0\
(The error changes accordingly but there is noMicrosoft.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.47am-搞定了。
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屋!