Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node packages not building on Windows 8.1 - Missing Microsoft.Cpp.Default.props

NPM packages are not building on Windows 8.1 - failing with following error,

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.

I have tried the following,

  • Setting an evironment variable VCTargetsPath to C:\Program Files (x86)\MSBuild\12.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

None of the above have worked.

I've spent ages on this already. Does anyone have a definite answer that works?

like image 765
Brendan Avatar asked Jan 12 '14 00:01

Brendan


2 Answers

The quick fix for me was this:

set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120 npm install 
like image 108
AVarabei Avatar answered Oct 10 '22 11:10

AVarabei


Finally Microsoft is providing much better solution to VS.

like image 23
igor Avatar answered Oct 10 '22 11:10

igor