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.

Windows: Cannot open include file: 'vips/intl.h' in latest version

See original GitHub issue

Windows: Cannot open include file: ‘vips/intl.h’ in latest version

Description

I am trying to install sharp on a windows 10 machine, and am seeing an error annot open include file: 'vips/intl.h' in latest version see full error message below.

Resolution Attempt

What I have tried I have tried everything that I can find online to resolve the issue. I have installed windows-build-tools, set my python path, npm config set python python2.7, npm config set msvs_version 2015, npm config set msvs_version 2017. Nothing seems to work so I started working back through the versions and found that sharp@0.20.5 installs without issues.

My Environment

node: v9.3.0 os: Windows 10 Pro 1709

Install

command I ran to install sharp

npm i sharp

Error

Error that came back after attempting to install

> sharp@0.20.8 install C:\temp\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached C:\Users\user\AppData\Roaming\npm-cache\_libvips\libvips-8.6.1-win32-x64.tar.gz
>(node:15952) UnhandledPromiseRejectionWarning: ZlibError: zlib: unexpected end of file
    at Zlib.(anonymous function).onerror (C:\temp\node_modules\minizlib\index.js:131:21)
    at Unzip.write (C:\temp\node_modules\minizlib\index.js:255:31)
    at Unzip.flush (C:\temp\node_modules\minizlib\index.js:222:10)
    at Unzip.end (C:\temp\node_modules\minizlib\index.js:229:10)
    at Unpack.end (C:\temp\node_modules\tar\lib\parse.js:415:21)
    at Yallist.pipes.forEach.p (C:\temp\node_modules\minipass\index.js:288:18)
    at Yallist.forEach (C:\temp\node_modules\yallist\yallist.js:154:8)
    at ReadStream.emit (C:\temp\node_modules\minipass\index.js:285:18)
    at ReadStream.emit (C:\temp\node_modules\fs-minipass\index.js:153:22)
    at ReadStream.[maybeEmitEnd] (C:\temp\node_modules\minipass\index.js:255:12)
(node:15952) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:15952) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
info sharp Creating C:\temp\node_modules\sharp\build\Release
info sharp Copying DLLs from C:\temp\node_modules\sharp\vendor\lib to C:\temp\node_modules\sharp\build\Release
ERR! sharp ENOENT: no such file or directory, scandir 'C:\temp\node_modules\sharp\vendor\lib'
prebuild-install WARN install No prebuilt binaries found (target=9.3.0 runtime=node arch=x64 platform=win32)

C:\temp\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  VError.cpp
  VInterpolate.cpp
  VImage.cpp
  win_delay_load_hook.cc
..\src\libvips\cplusplus\VError.cpp(33): fatal error C1083: Cannot open include file: 'vips/intl.h': No  such file or directory [C:\temp\node_modules\sharp\build\libvips-cpp.vcxproj]
..\src\libvips\cplusplus\VInterpolate.cpp(34): fatal error C1083: Cannot open include file: 'vips/intl. h': No such file or directory [C:\temp\node_modules\sharp\build\libvips-cpp.vcxproj]
..\src\libvips\cplusplus\VImage.cpp(41): fatal error C1083: Cannot open include file: 'vips/intl.h': No  such file or directory [C:\temp\node_modules\sharp\build\libvips-cpp.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\user\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:159:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\temp\node_modules\sharp
gyp ERR! node -v v9.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'C:\temp\package.json'
npm WARN temp No description
npm WARN temp No repository field.
npm WARN temp No README data
npm WARN temp No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.20.8 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.20.8 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\user\AppData\Roaming\npm-cache\_logs\2018-09-22T14_14_01_945Z-debug.log

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

20reactions
lovellcommented, Sep 22, 2018

Hello, does removing the cached (and from the zlib: unexpected end of file error somehow corrupted) C:\Users\user\AppData\Roaming\npm-cache\_libvips\libvips-8.6.1-win32-x64.tar.gz file help?

7reactions
Vultrazcommented, Oct 31, 2019

Turns out it was also a network problem for me. Downloading the file manually (https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-win32-x64.tar.gz in my case) and placing it in the \npm-cache\_libvips folder fixed the problem for me. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Not able to install Saltcorn in Windows 10 - Stack Overflow
If it does not have precompiled binaries available, sharp will try to build them for you on your machine using node-gyp.
Read more >
cannot open include file 'new.h': no such file or directory
Hi All,. I am trying to run a simple mfc demo application in visual studio 2015, but i am not able to build...
Read more >
VS 2022 RC - cannot open include file - Visual Studio Feedback
I installed VS 2022 RC Created a Windows Console Application project. #include <iostream> int main() { std::cout << "Hello World!\n"; }.
Read more >
The image resize endpoint redirects to the ... - Ghost Forum
Selected npm version 6.9.0 Updating iisnode.yml at ... fatal error C1083: Cannot open include file: 'vips/intl.h': No such file or directory ...
Read more >
Unable to Open include file stdio.h in turbo c FIXED - YouTube
Solution for Unable to Open include file stdio. h and unable to open file 'cos.obj' error This error occurs when turbo C is...
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