sharp: fatal error: 'vips/vips8' file not found
I’m having problems installing sharp in a clean node:12 container.
docker run --rm -it node:12 npm i sharp
> sharp@0.23.0 install /node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-linux-x64.tar.gz
prebuild-install WARN install libvips-cpp.so.42: cannot open shared object file: No such file or directory
make: Entering directory '/node_modules/sharp/build'
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
../src/common.cc:25:22: fatal error: vips/vips8: No such file or directory
#include <vips/vips8>
^
compilation terminated.
sharp.target.mk:135: recipe for target 'Release/obj.target/sharp/src/common.o' failed
make: *** [Release/obj.target/sharp/src/common.o] Error 1
make: Leaving directory '/node_modules/sharp/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack at ChildProcess.emit (events.js:209:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 5.0.0-29-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /node_modules/sharp
gyp ERR! node -v v12.10.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.23.0 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.23.0 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! /root/.npm/_logs/2019-09-23T18_08_09_973Z-debug.log
The issue is quite unfamiliar to me and i havent find the cause yet. Im posting early hoping somebody can point me in the right direction.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 32
- Comments: 41 (5 by maintainers)
Commits related to this issue
- Revert "Minor / auto-dependency updates" + This reverts commit 1b7bafd9 + Transitive dep minipass is currently sick and failing the build - see https://github.com/lovell/sharp/issues/1882 — committed to xh/hoist-dev-utils by amcclain 5 years ago
- 修复: :bug: 安装 `gatsby-plugin-sharp` 时报错 `fatal error: 'vips/vips8' file not found` `minipass` 依赖项导致了该问题,目前通过 `resolutions` 字段、Yarn 包管理器来解决该问题。问题细节参见: - https://github.com/lovell/sharp/issues/1882 - ... — committed to gelue-club/gelue.club by iTonyYo 5 years ago
- Fix travis build - Bump travis node version to 12 - Bump minipass to 2.8.5 to fix https://github.com/lovell/sharp/issues/1882#issuecomment-534472345 — committed to CruGlobal/campus-contacts-web by OzzieOrca 5 years ago
It looks like commit https://github.com/isaacs/minipass/commit/40e1d612d3d58e415362b1ebb97df8b69da5374f might have collided with https://github.com/mafintosh/end-of-stream/issues/11 and/or commit https://github.com/isaacs/minipass/commit/69888ebfbced926a9da61f044fdd733810a874d2 might have collided with https://github.com/npm/node-tar/commit/42fe53b413527983f2509ae606412ee1e93761d7
This will affect most modules that (transitively) depend on
minipass,tarand/orend-of-stream.Pinning minipass to v2.7.0 should workaround this for now.
For those using
yarn, you can add the following to yourpackage.json:Whatever is causing this problem, it looks like it’s affecting pretty much every native node module that provides prebuilt binaries
https://github.com/mapbox/node-pre-gyp/issues/477 https://github.com/mapbox/node-sqlite3/issues/1222
@imkane This issue is not closed, I am actively working on investigating it right now.
There was a breaking change in v2.8.2 of the upstream
minipassdependency that has now been reverted in its v2.8.5 release.If you work at a for-profit organisation that relies on sharp, and I can tell there are a lot of you based on the sheer volume of emails and notifications I’ve received about this problem over the last 15 hours, please consider donating to the libvips OpenCollective at https://opencollective.com/libvips to say thank you and help with its continued support.
I have same issue, without docker.
I have fixed our CI build by adding following to the
package.json:It’s silly because our app does not depend on
minipass.There have been no changes to sharp or the prebuilt binaries since 29th July.
I’ve received about 30 emails and notifications about this problem within the last hour so would expect this to relate to a (transitive) dependency that has been published within the last couple of hours.
Follow up on this issue here: https://github.com/isaacs/minipass/issues/9
I’ve removed the resolution for minipass and can confirm it works. Thank you @lovell
Just ran:
and then
Still got the same error.
I’m getting the same issue.
https://github.com/lovell/sharp/issues/1882#issuecomment-534266128 <-- this worked for me! Thanks so much, @lovell 🙏
I’m using lerna with npm. For those who are using npm and not yarn.
Add minipass as a dependency or dev-dependency depending on where your issues lie.
For me this affects:
@lerna/add)So far I’ve tried installing libvips-dev (https://github.com/lovell/sharp/issues/1882#issuecomment-534241405) and glib2.0-dev (https://github.com/lovell/sharp/issues/1148#issuecomment-370688930).
and the result is still:
for Ubuntu users:
apt install libvips-devfixes the issue for us.This issue is fixed for me with
minipass@^2.8.5, forced viaresolutionsinpackage.json(version pushed a few minutes ago)This workaround fixed the issue for us as well. Using
node:11.6.0Docker image.I have the same problem, it was because my network I couldn’t download
libvips-8.8.1-win32-x64.tar.gzsuccess, So I have to manual download it and put it on%appdata%/npm-cache/_libvips.Yes it worked on Docker with Node 12.10.0 image with libvips-dev.
This one did help so far:
Also seeing this attempting to install
sharp@0.22.1in a Google Cloud Function running Node 8:We’ve been running on this specific version of Sharp / Node / GCF for awhile now without any issues, it just began today.
I’m getting this issue too when trying to push to heroku.