question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Install on Windows 7 Pro failing, please help

See original GitHub issue

I 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-tools
  • npm install -g node-gyp

Then I added an environment variable for Python:

  • Computer -> Properties -> Advanced system settings -> Environment variables -> System variable
  • PYTHON = 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.exe failed 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:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lovellcommented, Sep 14, 2017

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.

1reaction
stephen-lastcommented, Sep 14, 2017

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 sharp like 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:

  • Windows 7 Pro
  • node 6.11.3 (6.10.1 didn’t work!)
  • npm 5.2.0 (5.4.1 didn’t work!)
  • Microsoft Visual C++ Build Tools (Visual C++ 2015 Build Tools)
  • Microsoft .NET Framework 4.7 (Vista / 7 only)
  • Python 2.7.13 (v3.x.x is not supported)
  • npm config set python <full-path-to-python.exe>
  • npm config set msvs_version 2015

I 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! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows 7 Update Failed [SOLVED] - Driver Easy
Fix 1: Run the Windows Update troubleshooter · Fix 2: Reset Windows Update components · Fix 3: Install the updates for your system...
Read more >
Get help with Windows upgrade and installation errors
See some of the most common upgrade and installation errors for Windows 10 and Windows 11, and what you can do to try...
Read more >
Windows 7 update not working | Dell US
Go back to Windows Update and turn on automatic updates by going to Control Panel, Windows Updates Select Install updates automatically under " ......
Read more >
Windows 7 Updates Not Downloading? Here's How to Fix It!
Fix 2: Manually Download and Install the Updates; Fix 3: Use the Microsoft Update Diagnostic Troubleshooting Tool; Fix 4: Modify the Permissions ...
Read more >
7 Ways To Fix Windows Update Errors If They Failed - Action1
It is possible that your drive simply lacks free storage space to install the update. See if you can make space by decluttering...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found