Install on Windows 7 Pro failing, please help
See original GitHub issueI really want to use sharp. I’ve followed the instructions but I’m getting errors.
I did these, both worked, no errors:
npm install -g --production windows-build-toolsnpm install -g node-gyp
Then I added an environment variable for Python:
Computer -> Properties -> Advanced system settings -> Environment variables -> System variablePYTHON = C:\Users\stephen.last\.windows-build-tools\python27\python.exe- Restarted cmd
Then I ran yarn add sharp in my project, but I’m getting this:
yarn add v0.22.0 [1/4] Resolving packages… [2/4] Fetching packages… warning fsevents@1.1.2: The platform “win32” is incompatible with this module. info “fsevents@1.1.2” is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies… [4/4] Building fresh packages… [1/1] ⢀ sharp: C:\node\sandbox\aws\node_modules\sharp\build\libvips-cpp.vcxproj(20,3): error MSB4019: The imported project "C:\Microso [-/1] ⢀ waiting… [-/1] ⢀ waiting… [-/1] ⢀ waiting… error C:\node\sandbox\aws\node_modules\sharp: Command failed. Exit code: 1 Command: C:\windows\system32\cmd.exe Arguments: /d /s /c node-gyp rebuild Directory: C:\node\sandbox\aws\node_modules\sharp Output: @ C:\node\sandbox\aws\node_modules\sharp $ if not defined npm_config_node_gyp (node “C:\Program Files (x86)\Yarn\bin\node-gyp-bin\…..\node_modules\node-gyp\bin\node-gyp.js” rebuild ) else (node rebuild ) gyp info it worked if it ends with ok gyp info using node-gyp@3.5.0 gyp info using node@6.10.1 | win32 | x64 gyp info spawn C:\Users\stephen.last.windows-build-tools\python27\python.exe gyp info spawn args [ ‘C:\Program Files (x86)\Yarn\node_modules\node-gyp\gyp\gyp_main.py’, gyp info spawn args ‘binding.gyp’, gyp info spawn args ‘-f’, gyp info spawn args ‘msvs’, gyp info spawn args ‘-G’, gyp info spawn args ‘msvs_version=auto’, gyp info spawn args ‘-I’, gyp info spawn args ‘C:\node\sandbox\aws\node_modules\sharp\build\config.gypi’, gyp info spawn args ‘-I’, gyp info spawn args ‘C:\Program Files (x86)\Yarn\node_modules\node-gyp\addon.gypi’, gyp info spawn args ‘-I’, gyp info spawn args ‘C:\Users\stephen.last\.node-gyp\6.10.1\include\node\common.gypi’, gyp info spawn args ‘-Dlibrary=shared_library’, gyp info spawn args ‘-Dvisibility=default’, gyp info spawn args ‘-Dnode_root_dir=C:\Users\stephen.last\.node-gyp\6.10.1’, gyp info spawn args ‘-Dnode_gyp_dir=C:\Program Files (x86)\Yarn\node_modules\node-gyp’, gyp info spawn args ‘-Dnode_lib_file=node.lib’, gyp info spawn args ‘-Dmodule_root_dir=C:\node\sandbox\aws\node_modules\sharp’, gyp info spawn args ‘–depth=.’, gyp info spawn args ‘–no-parallel’, gyp info spawn args ‘–generator-output’, gyp info spawn args ‘C:\node\sandbox\aws\node_modules\sharp\build’, gyp info spawn args ‘-Goutput_dir=.’ ] gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe gyp info spawn args [ ‘build/binding.sln’, gyp info spawn args ‘/clp:Verbosity=minimal’, gyp info spawn args ‘/nologo’, gyp info spawn args ‘/p:Configuration=Release;Platform=x64’ ] Building the projects in this solution one at a time. To enable parallel build, please add the “/m” switch. C:\node\sandbox\aws\node_modules\sharp\build\libvips-cpp.vcxproj(20,3): 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. gyp ERR! build error gyp ERR! stack Error:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exefailed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\Yarn\node_modules\node-gyp\lib\build.js:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Program Files (x86)\Yarn\node_modules\node-gyp\bin\node-gyp.js” “rebuild” gyp ERR! cwd C:\node\sandbox\aws\node_modules\sharp gyp ERR! node -v v6.10.1 gyp ERR! node-gyp -v v3.5.0 gyp ERR! not ok info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
How do I get this working…??
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)

Top Related StackOverflow Question
Glad to hear you got it working.
Please subscribe to #186 for updates about the provision of pre-built binaries, an approach similar to that used by node-sass.
Right… It’s taken me all day to get this working, I’ve done nothing else!
If there is any way, any way at all that sharp can be made to work on Windows by simply doing
npm i sharplike almost everything else installed via npm/yarn, that would help so much!I’m pretty sure that https://github.com/sass/node-sass uses C++, and that just installs, without having to go off and get lots of other things installed first.
Having no external runtime dependencies is great, but Windows users really need no external install time dependencies as well.
This is what I have installed right now, which is the only combination of software and versions that seems to work for me:
npm config set python <full-path-to-python.exe>npm config set msvs_version 2015I had to upgrade my node version, and downgrade my npm version. The downgrade has lead to other problems (with Atom and StandardJS) which I now have to sort out.
I’ve just tried sharp for the first time, I resized an image, it was blisteringly fast! Many thanks go to the maintainers of sharp! 👍