lovell / sharp-libvips

Packaging scripts to prebuild libvips and its dependencies - you're probably looking for https://github.com/lovell/sharp
Apache License 2.0
177 stars 100 forks source link

libvips build fails #37

Closed sasannnn closed 4 years ago

sasannnn commented 4 years ago

Trying to get a Gatsbyjs website up and running has gotten me to this error:

$ npm install
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

> sharp@0.22.1 install /home/sasann/Projects/gatsby-portfolio-dev/node_modules/gatsby-plugin-manifest/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /home/sasann/.npm/_libvips/libvips-8.7.4-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=13.8.0 runtime=node arch=x64 libc= platform=linux)
make: Entering directory '/home/sasann/Projects/gatsby-portfolio-dev/node_modules/gatsby-plugin-manifest/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
  CXX(target) Release/obj.target/sharp/src/metadata.o
  CXX(target) Release/obj.target/sharp/src/stats.o
../src/stats.cc: In member function ‘virtual void StatsWorker::HandleOKCallback()’:
../src/stats.cc:130:37: error: no matching function for call to ‘v8::Array::Set(int&, v8::Local<v8::Object>&)’
         channels->Set(i, channelStat);
                                     ^
In file included from /home/sasann/.cache/node-gyp/13.8.0/include/node/node.h:63:0,
                 from ../src/stats.cc:19:
/home/sasann/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note: candidate: v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
/home/sasann/.cache/node-gyp/13.8.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/home/sasann/.cache/node-gyp/13.8.0/include/node/v8.h:3550:37: note: candidate: v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                     ^~~
/home/sasann/.cache/node-gyp/13.8.0/include/node/v8.h:3550:37: note:   candidate expects 3 arguments, 2 provided
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-cast-function-type’
sharp.target.mk:138: recipe for target 'Release/obj.target/sharp/src/stats.o' failed
make: *** [Release/obj.target/sharp/src/stats.o] Error 1
make: Leaving directory '/home/sasann/Projects/gatsby-portfolio-dev/node_modules/gatsby-plugin-manifest/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/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 4.15.0-76-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/sasann/Projects/gatsby-portfolio-dev/node_modules/gatsby-plugin-manifest/node_modules/sharp
gyp ERR! node -v v13.8.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN eslint-config-react-app@5.2.0 requires a peer of babel-eslint@10.x but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-react-app@5.2.0 requires a peer of eslint@6.x but none is installed. You must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.22.1 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.22.1 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!     /home/sasann/.npm/_logs/2020-02-12T09_34_51_163Z-debug.log

If I understand correctly, It tries to compile libvips and fails. When I run ./confgure on a libvips tarball it runs fine so I don't know what dependency I'm missing.

lovell commented 4 years ago

Support for Node.js 13 was added in sharp v0.23.2.

https://sharp.pixelplumbing.com/changelog#v0232---28supthsup-october-2019

sasannnn commented 4 years ago

Thanks for the quick reply. I've sent a PR to the original project which fixed this.