Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sharp@0.20.8 install error #1776

Closed
khteh opened this issue Jul 3, 2019 · 4 comments
Closed

sharp@0.20.8 install error #1776

khteh opened this issue Jul 3, 2019 · 4 comments
Labels

Comments

@khteh
Copy link

khteh commented Jul 3, 2019

What is the output of running npm install --verbose sharp?

$ npm install --verbose sharp
npm info it worked if it ends with ok
npm verb cli [ '/usr/bin/node', '/usr/bin/npm', 'install', '--verbose', 'sharp' ]
npm info using npm@6.9.0
npm info using node@v12.5.0
npm verb npm-session 7a1447b5e663092b
npm http fetch GET 304 https://registry.npmjs.org/sharp 347ms (from cache)
npm timing stage:loadCurrentTree Completed in 3106ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 32ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 1881ms
npm http fetch GET 200 https://registry.npmjs.org/detect-libc 52ms
npm http fetch GET 200 https://registry.npmjs.org/fs-copy-file-sync 80ms
npm http fetch GET 304 https://registry.npmjs.org/semver 81ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tunnel-agent 86ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/simple-get 87ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/prebuild-install 95ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/node-abi 21ms
npm http fetch GET 200 https://registry.npmjs.org/which-pm-runs 21ms
npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils 30ms
npm http fetch GET 200 https://registry.npmjs.org/tar-fs 35ms
npm http fetch GET 200 https://registry.npmjs.org/noop-logger 45ms
npm http fetch GET 200 https://registry.npmjs.org/github-from-package 53ms
npm http fetch GET 304 https://registry.npmjs.org/minimist 55ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/expand-template 59ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/pump 21ms
npm http fetch GET 304 https://registry.npmjs.org/pump/-/pump-1.0.3.tgz 30ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 8194ms
npm timing stage:loadIdealTree Completed in 10850ms
npm timing stage:generateActionsToTake Completed in 122ms
npm verb correctMkdir /home/khteh/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /home/khteh/.npm/_locks/staging-74a0e6b285e965cd.lock for /usr/src/4xlabs/bz-ui2/node_modules/.staging
npm timing action:extract Completed in 213ms
npm info lifecycle sharp@0.22.1~preuninstall: sharp@0.22.1
npm info lifecycle sharp@0.22.1~uninstall: sharp@0.22.1
npm verb unbuild rmStuff sharp@0.22.1 from /usr/src/4xlabs/bz-ui2/node_modules
npm info lifecycle sharp@0.22.1~postuninstall: sharp@0.22.1
npm info lifecycle tar@4.4.10~preuninstall: tar@4.4.10
npm info lifecycle tar@4.4.10~uninstall: tar@4.4.10
npm verb unbuild rmStuff tar@4.4.10 from /usr/src/4xlabs/bz-ui2/node_modules
npm verb unbuild rmStuff in /usr/src/4xlabs/bz-ui2/node_modules/sharp/node_modules
npm info lifecycle tar@4.4.10~postuninstall: tar@4.4.10
npm info lifecycle yallist@3.0.3~preuninstall: yallist@3.0.3
npm info lifecycle yallist@3.0.3~uninstall: yallist@3.0.3
npm verb unbuild rmStuff yallist@3.0.3 from /usr/src/4xlabs/bz-ui2/node_modules
npm verb unbuild rmStuff in /usr/src/4xlabs/bz-ui2/node_modules/sharp/node_modules
npm info lifecycle yallist@3.0.3~postuninstall: yallist@3.0.3
npm timing action:unbuild Completed in 8ms
npm timing action:remove Completed in 22ms
npm timing action:finalize Completed in 80ms
npm timing action:refresh-package-json Completed in 109ms
npm info lifecycle sharp@0.22.1~preinstall: sharp@0.22.1
npm timing action:preinstall Completed in 0ms
npm info linkStuff sharp@0.22.1
npm timing action:build Completed in 6ms
npm info lifecycle sharp@0.22.1~install: sharp@0.22.1

> sharp@0.22.1 install /usr/src/4xlabs/bz-ui2/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.7.4/libvips-8.7.4-linux-x64.tar.gz
prebuild-install info begin Prebuild-install version 5.3.0
prebuild-install info looking for cached prebuild @ /home/khteh/.npm/_prebuilds/37a21b-sharp-v0.22.1-node-v72-linux-x64.tar.gz
prebuild-install http request GET https://github.com/lovell/sharp/releases/download/v0.22.1/sharp-v0.22.1-node-v72-linux-x64.tar.gz
prebuild-install http 200 https://github.com/lovell/sharp/releases/download/v0.22.1/sharp-v0.22.1-node-v72-linux-x64.tar.gz
prebuild-install info downloading to @ /home/khteh/.npm/_prebuilds/37a21b-sharp-v0.22.1-node-v72-linux-x64.tar.gz.7792-008d4852650cb.tmp
prebuild-install info renaming to @ /home/khteh/.npm/_prebuilds/37a21b-sharp-v0.22.1-node-v72-linux-x64.tar.gz
prebuild-install info unpacking @ /home/khteh/.npm/_prebuilds/37a21b-sharp-v0.22.1-node-v72-linux-x64.tar.gz
prebuild-install info unpack resolved to /usr/src/4xlabs/bz-ui2/node_modules/sharp/build/Release/sharp.node
prebuild-install info unpack required /usr/src/4xlabs/bz-ui2/node_modules/sharp/build/Release/sharp.node successfully
prebuild-install info install Successfully installed prebuilt binary!
npm verb lifecycle sharp@0.22.1~install: unsafe-perm in lifecycle true
npm verb lifecycle sharp@0.22.1~install: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/usr/src/4xlabs/bz-ui2/node_modules/sharp/node_modules/.bin:/usr/src/4xlabs/bz-ui2/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/khteh/.dotnet/tools
npm verb lifecycle sharp@0.22.1~install: CWD: /usr/src/4xlabs/bz-ui2/node_modules/sharp
npm timing audit submit Completed in 911ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 911ms
npm timing audit body Completed in 2ms
npm timing action:install Completed in 8914ms
npm info lifecycle sharp@0.22.1~postinstall: sharp@0.22.1
npm timing action:postinstall Completed in 2ms
npm verb unlock done using /home/khteh/.npm/_locks/staging-74a0e6b285e965cd.lock for /usr/src/4xlabs/bz-ui2/node_modules/.staging
npm timing stage:executeActions Completed in 9380ms
npm timing stage:rollbackFailedOptional Completed in 65ms
npm timing stage:runTopLevelLifecycles Completed in 24105ms
npm verb saving [ { name: 'sharp', spec: '^0.22.1', save: 'dependencies' } ]
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm info lifecycle undefined~postshrinkwrap: undefined
npm WARN acorn-dynamic-import@4.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN acorn-jsx@5.0.1 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-material@1.1.19 requires a peer of angular-messages@1.4 - 1.7.0 || ^1.7.2 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.
npm WARN gulp-jshint@2.1.0 requires a peer of jshint@2.x but none is installed. You must install peer dependencies yourself.
npm WARN gulp-typescript@5.0.1 requires a peer of typescript@~2.7.1 || >=2.8.0-dev || >=2.9.0-dev || ~3.0.0 || >=3.0.0-dev || >=3.1.0-dev || >= 3.2.0-dev || >= 3.3.0-dev but none is installed. You must install peer dependencies yourself.
npm WARN null-loader@3.0.0 requires a peer of webpack@^4.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN bz-ui2 No repository field.
npm WARN bz-ui2 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   linux
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64

+ sharp@0.22.1
removed 2 packages, updated 1 package and audited 43933 packages in 25.386s
found 28 vulnerabilities (14 low, 8 moderate, 6 high)
  run `npm audit fix` to fix them, or `npm audit` for details
npm verb exit [ 0, true ]
npm timing npm Completed in 25572ms
npm info ok

What is the output of running npx envinfo --binaries --languages --system --utilities?

$ npx envinfo --binaries --languages --system --utilities
npx: installed 1 in 0.644s

  System:
    OS: Linux 5.0 Ubuntu 19.04 (Disco Dingo)
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 536.79 MB / 23.20 GB
    Container: Yes
    Shell: 5.0.3 - /bin/bash
  Binaries:
    Node: 12.5.0 - /usr/bin/node
    npm: 6.9.2 - /usr/local/bin/npm
  Utilities:
    Make: 4.2.1 - /usr/bin/make
    GCC: 8.3.0 - /usr/bin/gcc
    Git: 2.20.1 - /usr/bin/git
  Languages:
    Bash: 5.0.3 - /usr/bin/bash
    Perl: 5.28.1 - /usr/bin/perl
    Python: 3.7.3 - /usr/bin/python

Have you ensured the platform and version of Node.js used for npm install is the same as the platform and version of Node.js used at runtime?

Errors when running npm install:

1075 verbose stack Error: sharp@0.20.8 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
1075 verbose stack Exit status 1
1075 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
1075 verbose stack     at EventEmitter.emit (events.js:200:13)
1075 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
1075 verbose stack     at ChildProcess.emit (events.js:200:13)
1075 verbose stack     at maybeClose (internal/child_process.js:1021:16)
1075 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
1076 verbose pkgid sharp@0.20.8
1077 verbose cwd /usr/src/4xlabs/bz-ui2
1078 verbose Linux 5.0.0-20-generic
1079 verbose argv "/usr/bin/node" "/usr/bin/npm" "install"
1080 verbose node v12.5.0 
1081 verbose npm  v6.9.0  
1082 error code ELIFECYCLE
1083 error errno 1 
1084 error sharp@0.20.8 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
1084 error Exit status 1
1085 error Failed at the sharp@0.20.8 install script. 
1085 error This is probably not a problem with npm. There is likely additional logging output above.
1086 verbose exit [ 1, true ]
@khteh
Copy link
Author

khteh commented Jul 3, 2019

More detailed error:

prebuild-install WARN install No prebuilt binaries found (target=12.5.0 runtime=node arch=x64 platform=linux)
make: Entering directory '/usr/src/4xlabs/bz-ui2/node_modules/gulp-responsive/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:24:
../../../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../../../nan/nan.h:2298:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
In file included from ../src/common.cc:27:
../src/common.h: At global scope:
../src/common.h:82:20: error: ‘Handle’ is not a member of ‘v8’
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                    ^~~~~~
../src/common.h:82:37: error: expected primary-expression before ‘>’ token
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                     ^
../src/common.h:82:39: error: ‘obj’ was not declared in this scope
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                       ^~~
../src/common.h:82:56: error: expected primary-expression before ‘attr’
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                                        ^~~~
../src/common.h:82:60: error: expression list treated as compound expression in initializer [-fpermissive]
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                                            ^
../src/common.h:83:29: error: ‘Handle’ is not a member of ‘v8’
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                             ^~~~~~
../src/common.h:83:46: error: expected primary-expression before ‘>’ token
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                              ^
../src/common.h:83:48: error: ‘obj’ was not declared in this scope
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                                ^~~
../src/common.h:83:65: error: expected primary-expression before ‘attr’
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                                                 ^~~~
../src/common.h:84:48: error: ‘Handle’ is not a member of ‘v8’
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                ^~~~~~
../src/common.h:84:65: error: expected primary-expression before ‘>’ token
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                 ^
../src/common.h:84:67: error: ‘obj’ was not declared in this scope
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                   ^~~
../src/common.h:84:84: error: expected primary-expression before ‘attr’
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                                    ^~~~
../src/common.h:84:37: warning: variable templates only available with -std=c++14 or -std=gnu++14
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                     ^~~~~~
../src/common.h:84:89: error: expected ‘;’ before ‘{’ token
   template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                                         ^~
                                                                                         ;
../src/common.h:87:37: error: ‘Handle’ is not a member of ‘v8’
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                     ^~~~~~
../src/common.h:87:54: error: expected primary-expression before ‘>’ token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                      ^
../src/common.h:87:56: error: ‘obj’ was not declared in this scope
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                        ^~~
../src/common.h:87:73: error: expected primary-expression before ‘attr’
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                                         ^~~~
../src/common.h:87:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                          ^~~~~~
../src/common.h:87:78: error: expected ‘;’ before ‘{’ token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                                                              ^~
                                                                              ;
../src/common.h:90:37: error: ‘Handle’ is not a member of ‘v8’
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                     ^~~~~~
../src/common.h:90:54: error: expected primary-expression before ‘>’ token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                      ^
../src/common.h:90:56: error: ‘obj’ was not declared in this scope
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                        ^~~
../src/common.h:90:61: error: expected primary-expression before ‘int’
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                             ^~~
../src/common.h:87:26: warning: variable templates only available with -std=c++14 or -std=gnu++14
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                          ^~~~~~
../src/common.h:90:70: error: expected ‘;’ before ‘{’ token
   template<typename T> T AttrTo(v8::Handle<v8::Object> obj, int attr) {
                                                                      ^~
                                                                      ;
../src/common.h:96:9: error: ‘Handle’ is not a member of ‘v8’
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
         ^~~~~~
../src/common.h:96:26: error: expected primary-expression before ‘>’ token
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                          ^
../src/common.h:96:28: error: ‘input’ was not declared in this scope
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                            ^~~~~
../src/common.h:96:28: note: suggested alternative: ‘ino_t’
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                            ^~~~~
                            ino_t
../src/common.h:96:70: error: expected primary-expression before ‘&’ token
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                                                                      ^
../src/common.h:96:71: error: ‘buffersToPersist’ was not declared in this scope
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                                                                       ^~~~~~~~~~~~~~~~
../src/common.h:96:87: error: expression list treated as compound expression in initializer [-fpermissive]
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist);
                                                                                       ^
../src/common.cc:34:20: error: redefinition of ‘bool sharp::HasAttr’
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                    ^~~~~~
In file included from ../src/common.cc:27:
../src/common.h:82:8: note: ‘bool sharp::HasAttr’ previously defined here
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
        ^~~~~~~
../src/common.cc:34:20: error: ‘Handle’ is not a member of ‘v8’
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                    ^~~~~~
../src/common.cc:34:37: error: expected primary-expression before ‘>’ token
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                                     ^
../src/common.cc:34:39: error: ‘obj’ was not declared in this scope
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                                       ^~~
../src/common.cc:34:56: error: expected primary-expression before ‘attr’
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr) {
                                                        ^~~~
../src/common.cc:37:29: error: redefinition of ‘std::string sharp::AttrAsStr’
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                             ^~~~~~
In file included from ../src/common.cc:27:
../src/common.h:83:15: note: ‘std::string sharp::AttrAsStr’ previously declared here
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
               ^~~~~~~~~
../src/common.cc:37:29: error: ‘Handle’ is not a member of ‘v8’
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                             ^~~~~~
../src/common.cc:37:46: error: expected primary-expression before ‘>’ token
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                                              ^
../src/common.cc:37:48: error: ‘obj’ was not declared in this scope
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                                                ^~~
../src/common.cc:37:65: error: expected primary-expression before ‘attr’
   std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr) {
                                                                 ^~~~
../src/common.cc:43:9: error: redefinition of ‘sharp::InputDescriptor* sharp::CreateInputDescriptor’
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
         ^~~~~~
In file included from ../src/common.cc:27:
../src/common.h:95:20: note: ‘sharp::InputDescriptor* sharp::CreateInputDescriptor’ previously defined here
   InputDescriptor* CreateInputDescriptor(
                    ^~~~~~~~~~~~~~~~~~~~~
../src/common.cc:43:9: error: ‘Handle’ is not a member of ‘v8’
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
         ^~~~~~
../src/common.cc:43:26: error: expected primary-expression before ‘>’ token
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
                          ^
../src/common.cc:43:28: error: ‘input’ was not declared in this scope
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
                            ^~~~~
../src/common.cc:43:28: note: suggested alternative: ‘ino_t’
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
                            ^~~~~
                            ino_t
../src/common.cc:43:70: error: expected primary-expression before ‘&’ token
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
                                                                      ^
../src/common.cc:43:71: error: ‘buffersToPersist’ was not declared in this scope
     v8::Handle<v8::Object> input, std::vector<v8::Local<v8::Object>> &buffersToPersist
                                                                       ^~~~~~~~~~~~~~~~
In file included from /home/khteh/.node-gyp/12.5.0/include/node/node.h:63,
                 from ../src/common.cc:22:
/home/khteh/.node-gyp/12.5.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/khteh/.node-gyp/12.5.0/include/node/node_object_wrap.h:84:78:   required from here
/home/khteh/.node-gyp/12.5.0/include/node/v8.h:9846:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/khteh/.node-gyp/12.5.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../../../nan/nan_object_wrap.h:65:61:   required from here
/home/khteh/.node-gyp/12.5.0/include/node/v8.h:9846:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
make: *** [sharp.target.mk:132: Release/obj.target/sharp/src/common.o] Error 1
make: Leaving directory '/usr/src/4xlabs/bz-ui2/node_modules/gulp-responsive/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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 5.0.0-20-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/src/4xlabs/bz-ui2/node_modules/gulp-responsive/node_modules/sharp
gyp ERR! node -v v12.5.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN acorn-dynamic-import@4.0.0 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN acorn-jsx@5.0.1 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angular-material@1.1.19 requires a peer of angular-messages@1.4 - 1.7.0 || ^1.7.2 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.
npm WARN gulp-jshint@2.1.0 requires a peer of jshint@2.x but none is installed. You must install peer dependencies yourself.
npm WARN gulp-typescript@5.0.1 requires a peer of typescript@~2.7.1 || >=2.8.0-dev || >=2.9.0-dev || ~3.0.0 || >=3.0.0-dev || >=3.1.0-dev || >= 3.2.0-dev || >= 3.3.0-dev but none is installed. You must install peer dependencies yourself.
npm WARN null-loader@3.0.0 requires a peer of webpack@^4.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN bz-ui2 No repository field.
npm WARN bz-ui2 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

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!     /home/khteh/.npm/_logs/2019-07-03T03_59_19_828Z-debug.log

@lovell
Copy link
Owner

lovell commented Jul 3, 2019

Node.js 12 support was added in v0.22.1.

https://sharp.pixelplumbing.com/en/stable/changelog/#v0221-25th-april-2019

@curran
Copy link

curran commented Jan 14, 2020

Is Node.js 13 supported? I'm seeing the following errors when attempting to install Sharp with Node 13.

$node --version
v13.6.0
$ npm --version
6.13.4

In Ubuntu Linux 19.10.

> sharp@0.22.1 install /home/curran/repos/vizhub/packages/imageGenerationService/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

make: Entering directory '/home/curran/repos/vizhub/packages/imageGenerationService/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
make: Leaving directory '/home/curran/repos/vizhub/packages/imageGenerationService/node_modules/sharp/build'

lerna ERR! npm install stderr:
info sharp Using cached /home/curran/.npm/_libvips/libvips-8.7.4-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=13.6.0 runtime=node arch=x64 libc= platform=linux)
../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>&)’
  130 |         channels->Set(i, channelStat);
      |                                     ^
In file included from /home/curran/.cache/node-gyp/13.6.0/include/node/node.h:63,
                 from ../src/stats.cc:19:
/home/curran/.cache/node-gyp/13.6.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>)’
 3547 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
/home/curran/.cache/node-gyp/13.6.0/include/node/v8.h:3547:37: note:   candidate expects 3 arguments, 2 provided
/home/curran/.cache/node-gyp/13.6.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>)’
 3550 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
      |                                     ^~~
/home/curran/.cache/node-gyp/13.6.0/include/node/v8.h:3550:37: note:   candidate expects 3 arguments, 2 provided
make: *** [sharp.target.mk:138: 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 (/home/curran/.nvm/versions/node/v13.6.0/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 5.3.0-18-generic
gyp ERR! command "/home/curran/.nvm/versions/node/v13.6.0/bin/node" "/home/curran/.nvm/versions/node/v13.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/curran/repos/vizhub/packages/imageGenerationService/node_modules/sharp
gyp ERR! node -v v13.6.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN vizhub-image-generation-service@1.0.0 No description
npm WARN vizhub-image-generation-service@1.0.0 No repository field.

@lovell
Copy link
Owner

lovell commented Jan 14, 2020

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

https://sharp.pixelplumbing.com/en/stable/changelog/#v0232-28th-october-2019

Repository owner locked and limited conversation to collaborators Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants