itsthatguy / avatars-api-middleware

The express middleware for our avatars service
http://avatars.adorable.io
Other
749 stars 96 forks source link

Library can't be installed #103

Open rptoma opened 4 years ago

rptoma commented 4 years ago

The library can not be installed.

Node version 14.2.0 npm version 6.14.5

OS: macOS Catalina 10.15.3

I think it is because of the sharp dependency which needs to be updated.

If you try to install that version of sharp in the project, it would give the same error. The latest sharp version works, though.

It might be that that version of sharp is not supported on macOS Catalina: https://github.com/cncf/landscapeapp/issues/475.

> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /Users/username/.npm/_libvips/libvips-8.7.4-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=14.2.0 runtime=node arch=x64 libc= platform=darwin)
  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:130:19: error: no matching member function for call to 'Set'
        channels->Set(i, channelStat);
        ~~~~~~~~~~^~~
/Users/username/Library/Caches/node-gyp/14.2.0/include/node/v8.h:3639:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/username/Library/Caches/node-gyp/14.2.0/include/node/v8.h:3642:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
1 error generated.
make: *** [Release/obj.target/sharp/src/stats.o] Error 1
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:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/Cellar/node/14.2.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/username/Documents/Disertatie/project-name-backend/node_modules/sharp
gyp ERR! node -v v14.2.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN project-name@1.0.0 No description
npm WARN project-name@1.0.0 No repository field.

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!     /Users/username/.npm/_logs/2020-05-19T11_38_54_024Z-debug.log
username@s-MacBook-Pro- project-name-backend % 
rptoma commented 4 years ago

I created a PR #104

rylnd commented 4 years ago

Hey @rptoma! It looks like you're using a newer version of node than is currently supported. As a temporary workaround, you may be able to use node 10.x as that appears to use a prebuilt version of sharp-libvps.

antonlukin commented 4 years ago

Hello there. I think it's a good idea to support the current nodejs version.

parostatkiem-zz commented 3 years ago

Bump: I came across this library of wonderful avatars and I'd like to use it. Sadly, it doesn't support the LTS Nodejs 😞

rylnd commented 2 years ago

I've just released version 0.5.0, which specifies node >= 10.x and includes an updated version of the sharp package.