MSB4019: The imported project "c:\Microsoft.Cpp.Default.props" was not found (was: Unable to install on windows 10 x64)
See original GitHub issueI’m running on windows 10 x64, Node x64 8.1.2 and I seem unable to install sharp. I originally noticed the problem via a plugin which has sharp as a dependency and traced it through to here.
( Original issue: https://github.com/gatsbyjs/gatsby/issues/2419 )
If I npm i sharp i get the following error, does anyone see where this is failing what I could try?
c:\github\gatsby-blog>npm i sharp
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but npm-shrinkwrap.json was generated for lockfileVersion@0. I'll try to do my best with it!
> sharp@0.18.4 install c:\github\gatsby-blog\node_modules\sharp
> node-gyp rebuild
c:\github\gatsby-blog\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Users\douga\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
c:\github\gatsby-blog\node_modules\sharp\build\libvips-cpp.vcxproj(20,3): error MSB4019: The impor
ted 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.
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\douga\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\douga\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\github\gatsby-blog\node_modules\sharp
gyp ERR! node -v v8.1.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN react-router-scroll@0.4.1 requires a peer of prop-types@^15.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN gatsby-starter-default@1.0.0 No repository field.
npm WARN The package gatsby-cli is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.18.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.18.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\douga\AppData\Roaming\npm-cache\_logs\2017-10-11T16_27_40_868Z-debug.log
I see a number of issues here relating to the same issue which all seem to point to problems with C++ redistributable etc. I should mention I have VS2017 installed, plus the 2015 build tools and have tried setting to both 2015 and 2017 without any joy.
Additionally, other node-gyp packages, such as node-sass build ok for me, so I’m not convinced it’s an issue with that (or at least one which is generic enough to cause everything to fail for me)
Issue Analytics
- State:
 - Created 6 years ago
 - Comments:13 (5 by maintainers)
 

Top Related StackOverflow Question
YES! finally got it working! there seemed to be two issues primarily.
No
VCTargetsPathset - I set mine as a system level environment variable to the following pathC:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140this seemed to solve the first issue where it couldn’t find theMicrosoft.Cpp.Default.propsfile.Missing 8.1 SDK from the MS
visualcppbuildtools_full.exe- I had only originally selected every except 8.1 and had selected 10…because i’m on windows 10,node-gypneeds 8.1 it seems.What didn’t aid the confusion was that the paths to the VC build tools are not very clear, here’s my registry structure for example:
Either way it’s all sorted now, if anyone wants to ask specific questions, best be quick whilst I remember the process!
@srinivasants Wrong repo.