Node packages not building on Windows 8.1 - Missing Microsoft.Cpp.Default.props
So it is 2.47am - figured it out.
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.
npm install -g karma error MSB4019: The imported project C:\Microsoft.Cpp.Default.props was not found
I had the same issue with other modules after installing VS Express 2013 for web alongside VS Express 2012 for Windows.
The solution was to install VS 2013 for Windows and use the switch
npm install --msvs_version=2013
Why does MSBuild look in C:\ for Microsoft.Cpp.Default.props instead of c:\Program Files (x86)\MSBuild? ( error MSB4019)
For those who didn't follow the MS proscribed order (see Xv's answer) you can still fix the problem.
MSBuild uses the VCTargetsPath
to locate default cpp properties but cannot because the registry lacks this String Value.
Check for the String Value
- Launch regedit
- Navigator to
HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0
- Inspect
VCTargetsPath
key. The value should = "$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\
"
To fix
- Launch regedit Navigator to
HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0
- Add String Value
VCTargetsPath
- Set Value to "
$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\
"
Note: HKLM
stands for HKEY_LOCAL_MACHINE
.
Related Topics
Stl Map Should Use Find() or [N] Identifier to Find Element in Map
How to Store a Lambda Expression as a Field of a Class in C++11
How to Use Lambda Auto Parameters in C++11
Program Being Compiled Differently in 3 Major C++ Compilers. Which One Is Right
When Do We Need to Have a Default Constructor
Difference Between Invalidaterect and Redrawwindow
How to Choose Heap Allocation VS. Stack Allocation in C++
How to Overload a Function That Can Tell a Fixed Array from a Pointer
Overload Resolution and Arrays: Which Function Should Be Called
How to Set Application Icon in a Qt-Based Project
C++11 Constexpr Flatten List of Std::Array into Array
When Should We Use Sizeof with and Without Parentheses