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

I can't install Sharp in Mac OSX #1683

Closed
enzolutions opened this issue May 1, 2019 · 6 comments
Closed

I can't install Sharp in Mac OSX #1683

enzolutions opened this issue May 1, 2019 · 6 comments

Comments

@enzolutions
Copy link

I am trying to install sharp for a Gatsby Js project.

First I installed libffi & vips using the following command

$ brew reinstall libffi

$set -gx PKG_CONFIG_PATH "/usr/local/opt/libffi/lib/pkgconfig"
$set -gx LDFLAGS "-L/usr/local/opt/libffi/lib"

$brew install vips

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

npm info it worked if it ends with ok
npm verb cli [
npm verb cli   '/usr/local/Cellar/node/12.1.0/bin/node',
npm verb cli   '/usr/local/bin/npm',
npm verb cli   'install',
npm verb cli   '--verbose',
npm verb cli   'sharp'
npm verb cli ]
npm info using npm@6.9.0
npm info using node@v12.1.0
npm verb npm-session 0cf9ec6de2a2ee56
npm http fetch GET 200 https://registry.npmjs.org/sharp 20ms (from cache)
npm timing stage:loadCurrentTree Completed in 3311ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 36ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 1594ms
npm http fetch GET 200 https://registry.npmjs.org/detect-libc 39ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/fs-copy-file-sync 39ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 39ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/semver 40ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/simple-get 40ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/tar 43ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/color 47ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/nan 45ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/npmlog 46ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/are-we-there-yet 7ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/console-control-strings 7ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/gauge 8ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/delegates 3ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/has-unicode 8ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/string-width 8ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/wide-align 8ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/expand-template 17ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/github-from-package 17ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils 17ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/node-abi 18ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/noop-logger 17ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/os-homedir 18ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/pump 20ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/tar-fs 20ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/which-pm-runs 20ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/simple-concat 2ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/fs-minipass 9ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/minipass 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/minizlib 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/yallist 10ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/bindings 3ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/file-uri-to-path 3ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 4957ms
npm timing stage:loadIdealTree Completed in 7388ms
npm timing stage:generateActionsToTake Completed in 194ms
npm verb correctMkdir /Users/enzo/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /Users/enzo/.npm/_locks/staging-fc7ca383278c6608.lock for /Users/enzo/www/NextTown/node_modules/.staging
npm timing action:extract Completed in 242ms
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 /Users/enzo/www/NextTown/node_modules
npm info lifecycle sharp@0.22.1~postuninstall: sharp@0.22.1
npm info lifecycle undefined~preuninstall: undefined
npm info lifecycle undefined~uninstall: undefined
npm info lifecycle undefined~preuninstall: undefined
npm info lifecycle undefined~uninstall: undefined
npm info lifecycle undefined~preuninstall: undefined
npm info lifecycle undefined~uninstall: undefined
npm info lifecycle undefined~preuninstall: undefined
npm info lifecycle undefined~uninstall: undefined
npm info lifecycle undefined~preuninstall: undefined
npm info lifecycle undefined~uninstall: undefined
npm info lifecycle undefined~preuninstall: undefined
npm info lifecycle undefined~uninstall: undefined
npm timing action:unbuild Completed in 9ms
npm timing action:remove Completed in 25ms
npm timing action:finalize Completed in 9ms
npm timing action:refresh-package-json Completed in 16ms
npm info lifecycle sharp@0.21.3~preinstall: sharp@0.21.3
npm info lifecycle gatsby-plugin-manifest@2.0.29~preinstall: gatsby-plugin-manifest@2.0.29
npm info lifecycle sharp@0.22.1~preinstall: sharp@0.22.1
npm timing action:preinstall Completed in 1ms
npm info linkStuff sharp@0.21.3
npm info linkStuff gatsby-plugin-manifest@2.0.29
npm info linkStuff sharp@0.22.1
npm timing action:build Completed in 2ms
npm info lifecycle sharp@0.21.3~install: sharp@0.21.3

> sharp@0.21.3 install /Users/enzo/www/NextTown/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 Detected globally-installed libvips v8.7.4
info sharp Building from source via node-gyp
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/usr/local/Cellar/node/12.1.0/bin/node',
gyp verb cli   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild'
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@12.1.0 | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "/usr/bin/python" in the PATH
gyp verb `which` succeeded /usr/bin/python /usr/bin/python
gyp verb check python version `/usr/bin/python -c "import sys; print "2.7.10
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 12.1.0
gyp verb command install [ '12.1.0' ]
gyp verb install input version string "12.1.0"
gyp verb install installing version: 12.1.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 12.1.0
gyp verb build dir attempting to create "build" dir: /Users/enzo/www/NextTown/node_modules/gatsby-plugin-manifest/node_modules/sharp/build
gyp verb build dir "build" dir needed to be created? /Users/enzo/www/NextTown/node_modules/gatsby-plugin-manifest/node_modules/sharp/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /Users/enzo/www/NextTown/node_modules/gatsby-plugin-manifest/node_modules/sharp/build/config.gypi
gyp verb config.gypi checking for gypi file: /Users/enzo/www/NextTown/node_modules/gatsby-plugin-manifest/node_modules/sharp/config.gypi
gyp verb common.gypi checking for gypi file: /Users/enzo/www/NextTown/node_modules/gatsby-plugin-manifest/node_modules/sharp/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/enzo/www/NextTown/node_modules/gatsby-plugin-manifest/node_modules/sharp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/enzo/.node-gyp/12.1.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/enzo/.node-gyp/12.1.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/enzo/.node-gyp/12.1.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/enzo/www/NextTown/node_modules/gatsby-plugin-manifest/node_modules/sharp',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /Users/enzo/.node-gyp/12.1.0
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  touch Release/obj.target/libvips-cpp.stamp
  c++ '-DNODE_GYP_MODULE_NAME=sharp' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/Users/enzo/.node-gyp/12.1.0/include/node -I/Users/enzo/.node-gyp/12.1.0/src -I/Users/enzo/.node-gyp/12.1.0/deps/openssl/config -I/Users/enzo/.node-gyp/12.1.0/deps/openssl/openssl/include -I/Users/enzo/.node-gyp/12.1.0/deps/uv/include -I/Users/enzo/.node-gyp/12.1.0/deps/zlib -I/Users/enzo/.node-gyp/12.1.0/deps/v8/include -I../../../../nan -I/usr/local/include -I/usr/include/libxml2 -I/usr/local/Cellar/libffi/3.2.1/lib/libffi-3.2.1/include -I/usr/local/Cellar/vips/8.7.4_2/include -I/usr/local/Cellar/glib/2.60.1/include -I/usr/local/Cellar/libgsf/1.14.45/include/libgsf-1 -I/usr/local/Cellar/fftw/3.3.8/include -I/usr/local/Cellar/imagemagick/7.0.8-42/include/ImageMagick-7 -I/usr/local/Cellar/orc/0.4.28/include/orc-0.4 -I/usr/local/Cellar/little-cms2/2.9/include -I/usr/local/Cellar/openexr/2.3.0/include/OpenEXR -I/usr/local/Cellar/ilmbase/2.3.0/include/OpenEXR -I/usr/local/Cellar/poppler/0.76.0/include/poppler/glib -I/usr/local/Cellar/poppler/0.76.0/include/poppler -I/usr/local/Cellar/librsvg/2.44.13/include/librsvg-2.0 -I/usr/local/Cellar/gdk-pixbuf/2.38.1/include/gdk-pixbuf-2.0 -I/usr/local/Cellar/cairo/1.16.0/include/cairo -I/usr/local/Cellar/pixman/0.38.4/include/pixman-1 -I/usr/local/Cellar/openslide/3.4.1_4/include/openslide -I/usr/local/Cellar/webp/1.0.2/include -I/usr/local/Cellar/pango/1.42.4_1/include/pango-1.0 -I/usr/local/Cellar/harfbuzz/2.4.0_1/include/harfbuzz -I/usr/local/Cellar/graphite2/1.3.13/include -I/usr/local/Cellar/fribidi/1.0.5/include/fribidi -I/usr/local/Cellar/fontconfig/2.13.1/include -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/libtiff/4.0.10_1/include -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/jpeg/9c/include -I/usr/local/Cellar/libexif/0.6.21/include -I/usr/local/Cellar/glib/2.60.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.60.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=c++11 -stdlib=libc++ -fexceptions -Wall -O3 -Wno-deprecated-declarations -MMD -MF ./Release/.deps/Release/obj.target/sharp/src/common.o.d.raw   -c -o Release/obj.target/sharp/src/common.o ../src/common.cc
In file included from ../src/common.cc:24:
In file included from ../../../../nan/nan.h:223:
In file included from ../../../../nan/nan_new.h:189:
../../../../nan/nan_implementation_12_inl.h:356:37: error: too few arguments to function call, expected 2, have 1
  return v8::StringObject::New(value).As<v8::StringObject>();
         ~~~~~~~~~~~~~~~~~~~~~      ^
/Users/enzo/.node-gyp/12.1.0/include/node/v8.h:5380:3: note: 'New' declared here
  static Local<Value> New(Isolate* isolate, Local<String> value);
  ^
In file included from ../src/common.cc:24:
In file included from ../../../../nan/nan.h:223:
In file included from ../../../../nan/nan_new.h:189:
../../../../nan/nan_implementation_12_inl.h:356:58: error: expected '(' for function-style cast or type construction
  return v8::StringObject::New(value).As<v8::StringObject>();
                                         ~~~~~~~~~~~~~~~~^
../../../../nan/nan_implementation_12_inl.h:356:60: error: expected expression
  return v8::StringObject::New(value).As<v8::StringObject>();
                                                           ^
In file included from ../src/common.cc:24:
In file included from ../../../../nan/nan.h:2722:
../../../../nan/nan_object_wrap.h:24:25: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(persistent().IsNearDeath());
           ~~~~~~~~~~~~ ^
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../src/common.cc:24:
In file included from ../../../../nan/nan.h:2722:
../../../../nan/nan_object_wrap.h:127:26: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
    assert(wrap->handle_.IsNearDeath());
           ~~~~~~~~~~~~~ ^
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
In file included from ../src/common.cc:27:
../src/common.h:78:20: error: no member named 'Handle' in namespace 'v8'
  bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
               ~~~~^
../src/common.h:78:37: error: expected '(' for function-style cast or type construction
  bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                          ~~~~~~~~~~^
../src/common.h:78:39: error: use of undeclared identifier 'obj'
  bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                      ^
../src/common.h:78:56: error: expected '(' for function-style cast or type construction
  bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                                           ~~~~~~~~~~~ ^
../src/common.h:79:29: error: no member named 'Handle' in namespace 'v8'
  std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                        ~~~~^
../src/common.h:79:46: error: expected '(' for function-style cast or type construction
  std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                   ~~~~~~~~~~^
../src/common.h:79:48: error: use of undeclared identifier 'obj'
  std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                               ^
../src/common.h:79:65: error: expected '(' for function-style cast or type construction
  std::string AttrAsStr(v8::Handle<v8::Object> obj, std::string attr);
                                                    ~~~~~~~~~~~ ^
../src/common.h:80:38: error: no member named 'Handle' in namespace 'v8'
  std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                 ~~~~^
../src/common.h:80:55: error: expected '(' for function-style cast or type construction
  std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                            ~~~~~~~~~~^
../src/common.h:80:57: error: use of undeclared identifier 'obj'
  std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                                        ^
../src/common.h:80:74: error: expected '(' for function-style cast or type construction
  std::vector<double> AttrAsRgba(v8::Handle<v8::Object> obj, std::string attr);
                                                             ~~~~~~~~~~~ ^
../src/common.h:81:37: warning: variable templates are a C++14 extension [-Wc++14-extensions]
  template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                    ^
../src/common.h:81:48: error: no member named 'Handle' in namespace 'v8'
  template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                           ~~~~^
../src/common.h:81:65: error: expected '(' for function-style cast or type construction
  template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                      ~~~~~~~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [Release/obj.target/sharp/src/common.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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/Cellar/node/12.1.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/enzo/www/NextTown/node_modules/gatsby-plugin-manifest/node_modules/sharp
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm verb lifecycle sharp@0.21.3~install: unsafe-perm in lifecycle true
npm verb lifecycle sharp@0.21.3~install: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/enzo/www/NextTown/node_modules/gatsby-plugin-manifest/node_modules/sharp/node_modules/.bin:/Users/enzo/www/NextTown/node_modules/gatsby-plugin-manifest/node_modules/.bin:/Users/enzo/www/NextTown/node_modules/.bin:/usr/local/gcc-arm-none-eabi-8-2018-q4-major/arm-none-eabi/bin/:/Users/enzo/.composer/vendor/bin:/usr/local/sbin:/Users/enzo/Library/Android/sdk/tools:/Users/enzo/Library/Android/sdk/platform-tools:/Users/enzo/.npm-packages/bin:/Users/enzo/golang/bin:/usr/local/go/bin:/usr/local/php5/bin:/Users/enzo/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/usr/local/go/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
npm verb lifecycle sharp@0.21.3~install: CWD: /Users/enzo/www/NextTown/node_modules/gatsby-plugin-manifest/node_modules/sharp
npm timing audit submit Completed in 1102ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 1103ms
npm timing audit body Completed in 1ms
npm info lifecycle sharp@0.21.3~install: Failed to exec install script
npm timing action:install Completed in 9577ms
npm verb unlock done using /Users/enzo/.npm/_locks/staging-fc7ca383278c6608.lock for /Users/enzo/www/NextTown/node_modules/.staging
npm timing stage:rollbackFailedOptional Completed in 24ms
npm timing stage:runTopLevelLifecycles Completed in 21375ms
npm WARN ts-pnp@1.1.2 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.

npm verb stack Error: sharp@0.21.3 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
npm verb stack     at EventEmitter.emit (events.js:196:13)
npm verb stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:196:13)
npm verb stack     at maybeClose (internal/child_process.js:1000:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
npm verb pkgid sharp@0.21.3
npm verb cwd /Users/enzo/www/NextTown
npm verb Darwin 17.7.0
npm verb argv "/usr/local/Cellar/node/12.1.0/bin/node" "/usr/local/bin/npm" "install" "--verbose" "sharp"
npm verb node v12.1.0
npm verb npm  v6.9.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.21.3 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.21.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 22482ms

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

  System:
    OS: macOS High Sierra 10.13.6
    CPU: (4) x64 Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz
    Memory: 220.98 MB / 16.00 GB
    Shell: 3.0.2 - /usr/local/bin/fish
  Binaries:
    Node: 12.1.0 - /usr/local/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Utilities:
    CMake: 3.13.4 - /usr/local/bin/cmake
    Make: 3.81 - /usr/bin/make
    GCC: 4.2.1 - /usr/bin/gcc
    Git: 2.20.1 - /usr/local/bin/git
  Languages:
    Bash: 3.2.57 - /bin/bash
    Go: 1.7.3 - /usr/local/go/bin/go
    Java: 1.8.0 - /usr/bin/javac
    Perl: 5.18.2 - /usr/bin/perl
    PHP: 7.3.4 - /usr/local/bin/php
    Python: 3.6.3 - /Users/enzo/.pyenv/shims/python
    Ruby: 2.6.1 - /usr/local/bin/ruby

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?

I don't understand this question.

@lovell
Copy link
Owner

lovell commented May 1, 2019

Please see gatsbyjs/gatsby#13646 for Node.js 12 support in Gatsby.

@lovell lovell closed this as completed May 1, 2019
@enzolutions
Copy link
Author

Thank you @lovell I will wait for that PR get merged.

@demisx
Copy link

demisx commented May 17, 2019

The gatsbyjs/gatsby#13646 was merged, but I still can't npm install sharp with node 12.1.0. Am I missing something?

...
../src/common.h:83:67: error: use of undeclared identifier 'obj'
  template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                  ^
../src/common.h:83:84: error: expected '(' for function-style cast or type construction
  template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                       ~~~~~~~~~~~ ^
../src/common.h:83:89: error: expected ';' at end of declaration
  template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                                        ^
                                                                                        ;
../src/common.h:83:90: error: expected unqualified-id
  template<typename T> v8::Local<T> AttrAs(v8::Handle<v8::Object> obj, std::string attr) {
                                                                                         ^
../src/common.h:86:26: warning: variable templates are a C++14 extension [-Wc++14-extensions]
  template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                         ^
../src/common.h:86:37: error: no member named 'Handle' in namespace 'v8'
  template<typename T> T AttrTo(v8::Handle<v8::Object> obj, std::string attr) {
                                ~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2 warnings and 20 errors generated.
make: *** [Release/obj.target/sharp/src/common.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:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/usr/local/Cellar/node/12.1.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/dmoore/projects/dl/lambda/process-new-photos/node_modules/sharp
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.22.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.22.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@lovell
Copy link
Owner

lovell commented May 18, 2019

@demisx Node 12 support was added in sharp 0.22.1 but this log says 0.22.0 is being installed.

@kenold
Copy link

kenold commented May 31, 2019

I'm getting the same error on Mac. Using sharp 0.22.1 with node 12.3.1. (Platform Gatsby v2)

2058 error sharp@0.22.1 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
2058 error Exit status 1
2059 error Failed at the sharp@0.22.1 install script.
2059 error This is probably not a problem with npm. There is likely additional logging output above.
2060 verbose exit [ 1, true ]

@kenold
Copy link

kenold commented May 31, 2019

Not sure if it was an npm issue, but it removed the node_modules folder and ran yarn install. It's OK now.

mikesten added a commit to mikesten/strapi-provider-upload-aws-s3-resizer that referenced this issue Apr 11, 2020
This version has support for node 12. See lovell/sharp#1683.
Repository owner locked and limited conversation to collaborators Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants