Sharp: Windows Installation Error: "E:\Microsoft.Cpp.Default.props" was not found

Created on 28 Apr 2016  路  6Comments  路  Source: lovell/sharp

I'm getting an issue when installing sharp on Windows (via gulp-responsive).

Operating System: Windows 7 SP1 x64
NodeJS Version: v0.12.2

I enclose the full npm-debug.txt.

How it appears when running npm install sharp is as follows.

$ npm install sharp

\
> [email protected] install E:\cartridge-images\node_modules\sharp
> node-gyp rebuild


E:\cartridge-images\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Users\tristanashley\AppData\Roaming\nvm\v0.12.2\n
ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (rebuild)
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
E:\cartridge-images\node_modules\sharp\build\libvips-cpp.vcxproj(18,3): error MSB4019: The imported project "E:\Microsoft.Cpp.Defaul
t.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: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\tristanashley\AppData\Roaming\nvm\v0.12.2\node_modules\npm\node_modules\node-gyp\
lib\build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Users\\tristanashley\\AppData\\Roaming\\nvm\\v0.12.2\\node_modules\\npm\\node_modules\\node-gyp\\bin\\no
de-gyp.js" "rebuild"
gyp ERR! cwd E:\cartridge-images\node_modules\sharp
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "shar
p"
npm ERR! node v0.12.2
npm ERR! npm  v2.7.4
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the sharp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls sharp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\cartridge-images\npm-debug.log

Our CI build (for a project that isn't worked on regularly) passed 13 days ago and recently failed with the error as noted above.

I have tried back-installing all the way to sharp v0.5.0, to no avail with the same error.

Apologise in advance if this is something on my end, though your help is greatly appreciated!

Regards

Tris

question

Most helpful comment

My Googling led me here for related issues.
I found this mighty handy package for dealing with MSBuild issues within npm:

npm install --global windows-build-tools

When it says "All done!" at the end - Have patience. It may still take quite a while (even tens of minutes) before cleanly exiting. Wait - Do not interrupt.

All 6 comments

The error here is MSB4019: The imported project "E:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

My best guess is that something is missing or incorrect with the installation of MSVC.

http://stackoverflow.com/questions/21069699/node-packages-not-building-on-windows-8-1-missing-microsoft-cpp-default-props

(and possibly http://stackoverflow.com/questions/16092169/why-does-msbuild-look-in-c-for-microsoft-cpp-default-props-instead-of-c-progr )

Thanks for the quick response and links!

I'll have a look into these

@tawashley Were you able to make any progress on this?

Hi @lovell. I've reviewed the links you've provided but still I'm unable to install correctly.

I have however tested this on a similar machine on mine, without issues. I'm convinced it is a setup issue on my end and not a code issue. I'm ok for this issue to be closed.

Thanks for the assistance!

Installing Standalone Build Tools solved this for me

http://landinghub.visualstudio.com/visual-cpp-build-tools

My Googling led me here for related issues.
I found this mighty handy package for dealing with MSBuild issues within npm:

npm install --global windows-build-tools

When it says "All done!" at the end - Have patience. It may still take quite a while (even tens of minutes) before cleanly exiting. Wait - Do not interrupt.

Was this page helpful?
0 / 5 - 0 ratings