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 cannot detect globally installed libvips (Apple M1) #3239

Closed
3 tasks done
hyunjinjeong opened this issue May 26, 2022 · 11 comments
Closed
3 tasks done

Sharp cannot detect globally installed libvips (Apple M1) #3239

hyunjinjeong opened this issue May 26, 2022 · 11 comments

Comments

@hyunjinjeong
Copy link

Possible install-time or require-time problem

  • I have read the documentation relating to installation.
  • I have ensured that the architecture and platform of Node.js used for npm install is the same as the architecture and platform of Node.js used at runtime.

Are you using the latest version of sharp?

  • I am using the latest version of sharp as reported by npm view sharp dist-tags.latest.

If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.

If you are using another package which depends on a version of sharp that is not the latest, please open an issue against that package instead.

Is this a problem with filesystem permissions?

If you are using npm v6 or earlier and installing as a root or sudo user, have you tried with the npm install --unsafe-perm flag?

If you are using npm v7 or later, does the user running npm install own the directory it is run in?

If you are using the ignore-scripts feature of npm, have you tried with the npm install --ignore-scripts=false flag?

What is the complete output of running npm install --verbose --foreground-scripts sharp in an empty directory?

npm verb cli /Users/user/.nvm/versions/node/v14.17.6/bin/node /Users/user/.nvm/versions/node/v14.17.6/bin/npm
npm info using npm@8.11.0
npm info using node@v14.17.6
npm timing npm:load:whichnode Completed in 0ms
npm timing config:load:defaults Completed in 2ms
npm timing config:load:file:/Users/user/.nvm/versions/node/v14.17.6/lib/node_modules/npm/npmrc Completed in 2ms
npm timing config:load:builtin Completed in 2ms
npm timing config:load:cli Completed in 3ms
npm timing config:load:env Completed in 0ms
npm timing config:load:file:/Users/user/dev/sharp-test/.npmrc Completed in 0ms
npm timing config:load:project Completed in 4ms
npm timing config:load:file:/Users/user/.npmrc Completed in 0ms
npm timing config:load:user Completed in 0ms
npm timing config:load:file:/Users/user/.nvm/versions/node/v14.17.6/etc/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:credentials Completed in 0ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 14ms
npm timing npm:load:configload Completed in 15ms
npm timing npm:load:mkdirpcache Completed in 0ms
npm timing npm:load:mkdirplogs Completed in 1ms
npm verb title npm install sharp
npm verb argv "install" "--loglevel" "verbose" "--foreground-scripts" "sharp"
npm timing npm:load:setTitle Completed in 8ms
npm timing config:load:flatten Completed in 3ms
npm timing npm:load:display Completed in 7ms
npm verb logfile logs-max:10 dir:/Users/user/.npm/_logs
npm verb logfile /Users/user/.npm/_logs/2022-05-26T03_17_03_078Z-debug-0.log
npm timing npm:load:logFile Completed in 5ms
npm timing npm:load:timers Completed in 0ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load Completed in 38ms
npm timing arborist:ctor Completed in 1ms
npm timing idealTree:init Completed in 6ms
npm timing idealTree:userRequests Completed in 3ms
npm http fetch GET 200 https://registry.npmjs.org/sharp 16ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/color 23ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/simple-get 19ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/semver 20ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/detect-libc 24ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 23ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/node-addon-api 24ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/tar-fs 23ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/tunnel-agent 24ms (cache hit)
npm timing idealTree:#root Completed in 61ms
npm http fetch GET 200 https://registry.npmjs.org/github-from-package 35ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/expand-template 44ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/npmlog 40ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/color-convert 49ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/node-abi 42ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/minimist 47ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/pump 42ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/decompress-response 41ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic 48ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic 41ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/lru-cache 43ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/simple-concat 43ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/chownr 43ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/once 44ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils 50ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/color-string 55ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/rc 48ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/tar-stream 45ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/safe-buffer 45ms (cache hit)
npm timing idealTree:node_modules/sharp Completed in 72ms
npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle 8ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/color-name 11ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/color-name 14ms (cache hit)
npm timing idealTree:node_modules/color Completed in 17ms
npm timing idealTree:node_modules/color-convert Completed in 2ms
npm timing idealTree:node_modules/color-name Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/is-arrayish 5ms (cache hit)
npm timing idealTree:node_modules/color-string Completed in 8ms
npm timing idealTree:node_modules/detect-libc Completed in 0ms
npm timing idealTree:node_modules/node-addon-api Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/end-of-stream 27ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/are-we-there-yet 32ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/set-blocking 33ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/ini 30ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/deep-extend 31ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/gauge 36ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/console-control-strings 37ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments 32ms (cache hit)
npm timing idealTree:node_modules/prebuild-install Completed in 48ms
npm timing idealTree:node_modules/expand-template Completed in 0ms
npm timing idealTree:node_modules/github-from-package Completed in 0ms
npm timing idealTree:node_modules/minimist Completed in 0ms
npm timing idealTree:node_modules/mkdirp-classic Completed in 0ms
npm timing idealTree:node_modules/napi-build-utils Completed in 0ms
npm timing idealTree:node_modules/node-abi Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/delegates 16ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/aproba 15ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/has-unicode 15ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/object-assign 16ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/string-width 18ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/signal-exit 20ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/readable-stream 22ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi 22ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/wide-align 24ms (cache hit)
npm timing idealTree:node_modules/npmlog Completed in 35ms
npm http fetch GET 200 https://registry.npmjs.org/core-util-is 17ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/inherits 17ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/process-nextick-args 17ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/isarray 18ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/util-deprecate 15ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/string_decoder 16ms (cache hit)
npm timing idealTree:node_modules/are-we-there-yet Completed in 25ms
npm timing idealTree:node_modules/console-control-strings Completed in 0ms
npm timing idealTree:node_modules/delegates Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point 7ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/ansi-regex 7ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/code-point-at 9ms (cache hit)
npm timing idealTree:node_modules/gauge Completed in 19ms
npm timing idealTree:node_modules/aproba Completed in 0ms
npm timing idealTree:node_modules/has-unicode Completed in 0ms
npm timing idealTree:node_modules/object-assign Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/wrappy 7ms (cache hit)
npm timing idealTree:node_modules/pump Completed in 17ms
npm timing idealTree:node_modules/end-of-stream Completed in 0ms
npm timing idealTree:node_modules/once Completed in 2ms
npm timing idealTree:node_modules/rc Completed in 2ms
npm timing idealTree:node_modules/deep-extend Completed in 0ms
npm timing idealTree:node_modules/ini Completed in 0ms
npm timing idealTree:node_modules/readable-stream Completed in 6ms
npm timing idealTree:node_modules/core-util-is Completed in 0ms
npm timing idealTree:node_modules/inherits Completed in 0ms
npm timing idealTree:node_modules/isarray Completed in 0ms
npm timing idealTree:node_modules/process-nextick-args Completed in 0ms
npm timing idealTree:node_modules/safe-buffer Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/yallist 5ms (cache hit)
npm timing idealTree:node_modules/semver Completed in 11ms
npm timing idealTree:node_modules/lru-cache Completed in 1ms
npm timing idealTree:node_modules/set-blocking Completed in 0ms
npm timing idealTree:node_modules/signal-exit Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/mimic-response 5ms (cache hit)
npm timing idealTree:node_modules/simple-get Completed in 9ms
npm timing idealTree:node_modules/decompress-response Completed in 3ms
npm timing idealTree:node_modules/mimic-response Completed in 0ms
npm timing idealTree:node_modules/simple-concat Completed in 0ms
npm timing idealTree:node_modules/simple-swizzle Completed in 2ms
npm timing idealTree:node_modules/is-arrayish Completed in 0ms
npm timing idealTree:node_modules/string_decoder Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/number-is-nan 7ms (cache hit)
npm timing idealTree:node_modules/string-width Completed in 14ms
npm timing idealTree:node_modules/code-point-at Completed in 0ms
npm timing idealTree:node_modules/is-fullwidth-code-point Completed in 3ms
npm timing idealTree:node_modules/number-is-nan Completed in 0ms
npm timing idealTree:node_modules/strip-ansi Completed in 0ms
npm timing idealTree:node_modules/ansi-regex Completed in 0ms
npm timing idealTree:node_modules/strip-json-comments Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/fs-constants 5ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/bl 6ms (cache hit)
npm timing idealTree:node_modules/tar-fs Completed in 9ms
npm timing idealTree:node_modules/chownr Completed in 0ms
npm http fetch GET 200 https://registry.npmjs.org/buffer 9ms (cache hit)
npm timing idealTree:node_modules/tar-stream Completed in 16ms
npm http fetch GET 200 https://registry.npmjs.org/ieee754 6ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/base64-js 7ms (cache hit)
npm timing idealTree:node_modules/bl Completed in 9ms
npm timing idealTree:node_modules/buffer Completed in 2ms
npm timing idealTree:node_modules/base64-js Completed in 0ms
npm timing idealTree:node_modules/fs-constants Completed in 0ms
npm timing idealTree:node_modules/ieee754 Completed in 0ms
npm timing idealTree:node_modules/tunnel-agent Completed in 0ms
npm timing idealTree:node_modules/util-deprecate Completed in 0ms
npm timing idealTree:node_modules/wide-align Completed in 0ms
npm timing idealTree:node_modules/wrappy Completed in 0ms
npm timing idealTree:node_modules/yallist Completed in 0ms
npm timing idealTree:node_modules/bl/node_modules/readable-stream Completed in 0ms
npm timing idealTree:node_modules/tar-stream/node_modules/readable-stream Completed in 0ms
npm timing idealTree:buildDeps Completed in 396ms
npm timing idealTree:fixDepFlags Completed in 1ms
npm timing idealTree Completed in 407ms
npm timing reify:loadTrees Completed in 407ms
npm timing reify:diffTrees Completed in 2ms
npm timing reify:retireShallow Completed in 1ms
npm timing reify:createSparse Completed in 24ms
npm timing reify:loadBundles Completed in 0ms
npm timing reifyNode:node_modules/ansi-regex Completed in 194ms
npm timing reifyNode:node_modules/chownr Completed in 195ms
npm timing reifyNode:node_modules/process-nextick-args Completed in 194ms
npm timing reifyNode:node_modules/ini Completed in 195ms
npm timing reifyNode:node_modules/wrappy Completed in 195ms
npm timing reifyNode:node_modules/end-of-stream Completed in 195ms
npm timing reifyNode:node_modules/has-unicode Completed in 195ms
npm timing reifyNode:node_modules/wide-align Completed in 195ms
npm timing reifyNode:node_modules/once Completed in 196ms
npm timing reifyNode:node_modules/aproba Completed in 196ms
npm timing reifyNode:node_modules/mkdirp-classic Completed in 197ms
npm timing reifyNode:node_modules/color-name Completed in 198ms
npm timing reifyNode:node_modules/color-string Completed in 198ms
npm timing reifyNode:node_modules/fs-constants Completed in 202ms
npm timing reifyNode:node_modules/ieee754 Completed in 202ms
npm timing reifyNode:node_modules/decompress-response Completed in 203ms
npm timing reifyNode:node_modules/lru-cache Completed in 202ms
npm timing reifyNode:node_modules/mimic-response Completed in 203ms
npm timing reifyNode:node_modules/inherits Completed in 202ms
npm timing reifyNode:node_modules/core-util-is Completed in 203ms
npm timing reifyNode:node_modules/signal-exit Completed in 203ms
npm timing reifyNode:node_modules/set-blocking Completed in 203ms
npm timing reifyNode:node_modules/console-control-strings Completed in 203ms
npm timing reifyNode:node_modules/color Completed in 205ms
npm timing reifyNode:node_modules/base64-js Completed in 208ms
npm timing reifyNode:node_modules/yallist Completed in 208ms
npm timing reifyNode:node_modules/util-deprecate Completed in 209ms
npm timing reifyNode:node_modules/expand-template Completed in 211ms
npm timing reifyNode:node_modules/simple-concat Completed in 215ms
npm timing reifyNode:node_modules/safe-buffer Completed in 214ms
npm timing reifyNode:node_modules/string_decoder Completed in 214ms
npm timing reifyNode:node_modules/deep-extend Completed in 214ms
npm timing reifyNode:node_modules/pump Completed in 213ms
npm timing reifyNode:node_modules/npmlog Completed in 214ms
npm timing reifyNode:node_modules/napi-build-utils Completed in 215ms
npm timing reifyNode:node_modules/is-arrayish Completed in 217ms
npm timing reifyNode:node_modules/delegates Completed in 217ms
npm timing reifyNode:node_modules/detect-libc Completed in 219ms
npm timing reifyNode:node_modules/are-we-there-yet Completed in 221ms
npm timing reifyNode:node_modules/color-convert Completed in 221ms
npm timing reifyNode:node_modules/tar-stream Completed in 227ms
npm timing reifyNode:node_modules/simple-get Completed in 252ms
npm timing reifyNode:node_modules/buffer Completed in 254ms
npm timing reifyNode:node_modules/rc Completed in 262ms
npm timing reifyNode:node_modules/prebuild-install Completed in 262ms
npm timing reifyNode:node_modules/bl Completed in 264ms
npm timing reifyNode:node_modules/node-abi Completed in 265ms
npm timing reifyNode:node_modules/minimist Completed in 270ms
npm timing reifyNode:node_modules/readable-stream Completed in 278ms
npm timing reifyNode:node_modules/bl/node_modules/readable-stream Completed in 321ms
npm timing reifyNode:node_modules/tar-stream/node_modules/readable-stream Completed in 324ms
npm timing reifyNode:node_modules/tar-fs Completed in 387ms
npm timing reifyNode:node_modules/node-addon-api Completed in 390ms
npm http fetch GET 200 https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz 351ms (cache miss)
npm timing reifyNode:node_modules/code-point-at Completed in 403ms
npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz 356ms (cache miss)
npm timing reifyNode:node_modules/is-fullwidth-code-point Completed in 406ms
npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz 347ms (cache miss)
npm timing reifyNode:node_modules/strip-json-comments Completed in 408ms
npm http fetch GET 200 https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz 363ms (cache miss)
npm timing reifyNode:node_modules/number-is-nan Completed in 411ms
npm http fetch GET 200 https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz 361ms (cache miss)
npm timing reifyNode:node_modules/isarray Completed in 414ms
npm http fetch GET 200 https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz 351ms (cache miss)
npm timing reifyNode:node_modules/object-assign Completed in 417ms
npm http fetch GET 200 https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz 348ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz 364ms (cache miss)
npm timing reifyNode:node_modules/strip-ansi Completed in 426ms
npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz 353ms (cache miss)
npm timing reifyNode:node_modules/simple-swizzle Completed in 428ms
npm http fetch GET 200 https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz 367ms (cache miss)
npm timing reifyNode:node_modules/string-width Completed in 431ms
npm http fetch GET 200 https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz 357ms (cache miss)
npm timing reifyNode:node_modules/tunnel-agent Completed in 433ms
npm timing reifyNode:node_modules/github-from-package Completed in 435ms
npm timing reifyNode:node_modules/semver Completed in 436ms
npm http fetch GET 200 https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz 375ms (cache miss)
npm timing reifyNode:node_modules/gauge Completed in 444ms
npm timing reifyNode:node_modules/sharp Completed in 447ms
npm timing reify:unpack Completed in 449ms
npm timing reify:unretire Completed in 0ms
npm timing build:queue Completed in 6ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 463ms
npm timing auditReport:getReport Completed in 465ms
npm timing auditReport:init Completed in 0ms
npm timing reify:audit Completed in 466ms
npm timing build:link:node_modules/prebuild-install Completed in 7ms
npm timing build:link:node_modules/rc Completed in 7ms
npm timing build:link:node_modules/semver Completed in 6ms
npm timing build:link Completed in 8ms
npm info run sharp@0.30.5 install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

> sharp@0.30.5 install
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-darwin-x64.tar.brstall/dll-copy && prebuild
sharp: Integrity check passed for darwin-x64 sharp@0.30.5 install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild
prebuild-install info begin Prebuild-install version 7.1.0install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild
prebuild-install info looking for local prebuild @ prebuilds/sharp-v0.30.5-napi-v5-darwin-x64.tar.gz
prebuild-install info looking for cached prebuild @ /Users/user/.npm/_prebuilds/7f4134-sharp-v0.30.5-napi-v5-darwin-x64.tar.gz
prebuild-install info found cached prebuild 
prebuild-install info unpacking @ /Users/user/.npm/_prebuilds/7f4134-sharp-v0.30.5-napi-v5-darwin-x64.tar.gz
prebuild-install info unpack resolved to /Users/user/dev/sharp-test/node_modules/sharp/build/Release/sharp-darwin-x64.node/dll-copy && prebuild
prebuild-install info install Successfully installed prebuilt binary!
npm info run sharp@0.30.5 install { code: 0, signal: null }
npm timing build:run:install:node_modules/sharp Completed in 3627ms
npm timing build:run:install Completed in 3627ms
npm timing build:deps Completed in 3642ms
npm timing build Completed in 3642ms
npm timing reify:build Completed in 3642ms
npm timing reify:trash Completed in 0ms
npm timing reify:save Completed in 37ms
npm timing reify Completed in 4599ms

added 67 packages, and audited 68 packages in 5s

8 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm timing command:install Completed in 4605ms
npm verb exit 0
npm timing npm Completed in 4705ms
npm info ok

What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?

  System:
    OS: macOS 12.4
    CPU: (10) x64 Apple M1 Pro
    Memory: 60.38 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 14.17.6 - ~/.nvm/versions/node/v14.17.6/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v14.17.6/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v14.17.6/bin/npm
@hyunjinjeong
Copy link
Author

hyunjinjeong commented May 26, 2022

Is there any way to force Sharp to use globally installed libvips?
I need to use it because HEIF files should be processed in our app.

libvips was installed using homebrew as follows.

$ which vips
/opt/homebrew/bin/vips

$ vips --version
vips-8.12.2-Tue Jan 25 09:34:32 UTC 2022

$ pkg-config --modversion vips-cpp
8.12.2

$ brew info vips
vips: stable 8.12.2 (bottled)
Image processing library
https://github.com/libvips/libvips
/opt/homebrew/Cellar/vips/8.12.2_2 (165 files, 13.7MB) *
  Poured from bottle on 2022-05-26 at 11:30:48
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/vips.rb
License: LGPL-2.1-or-later
==> Dependencies
Build: pkg-config ✔
Required: cairo ✔, cfitsio ✔, cgif ✔, fftw ✔, fontconfig ✔, freetype ✔, gdk-pixbuf ✔, gettext ✔, glib ✔, harfbuzz ✔, hdf5 ✔, imagemagick ✔, imath ✔, jpeg-xl ✔, libexif ✔, libgsf ✔, libheif ✔, libimagequant ✔, libmatio ✔, libpng ✔, librsvg ✔, libspng ✔, libtiff ✔, libxml2 ✔, little-cms2 ✔, mozjpeg ✔, openexr ✔, openjpeg ✔, openslide ✔, orc ✔, pango ✔, poppler ✔, webp ✔
==> Analytics
install: 7,677 (30 days), 28,276 (90 days), 101,966 (365 days)
install-on-request: 7,544 (30 days), 27,645 (90 days), 98,164 (365 days)
build-error: 0 (30 days)

@lovell
Copy link
Owner

lovell commented May 26, 2022

Please can you provide the output of the following command:

brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2

(There was a recent change in the way Homebrew paths are determined, which might be causing this.)

@hyunjinjeong
Copy link
Author

@lovell

Thanks for the quick reply! It is:

$ brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2

/usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/12

@lovell
Copy link
Owner

lovell commented May 26, 2022

Thank you, that looks OK to me. Please can you provide the output of the following command:

brew environment --plain | grep PKG_CONFIG_

@hyunjinjeong
Copy link
Author

@lovell

Sure! The result is:

$ brew environment --plain | grep PKG_CONFIG_

PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/12

And below is the full list of brew environment in case you need it.

$ brew environment

HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j10
CMAKE_PREFIX_PATH: /opt/homebrew
CMAKE_INCLUDE_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/opt/homebrew/Library/Homebrew/os/mac/pkgconfig/12
HOMEBREW_GIT: git
HOMEBREW_SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
ACLOCAL_PATH: /opt/homebrew/share/aclocal
PATH: /opt/homebrew/Library/Homebrew/shims/mac/super:/usr/bin:/bin:/usr/sbin:/sbin

@lovell
Copy link
Owner

lovell commented May 26, 2022

Thank you, I think I know what's causing this. Are you able to use the previous sharp v0.30.4 as a workaround for now?

@hyunjinjeong
Copy link
Author

@lovell

v0.30.4 works perfectly. Thank you!

sharp: Detected globally-installed libvips v8.12.2

@lovell lovell added this to the v0.30.6 milestone May 28, 2022
@lovell
Copy link
Owner

lovell commented May 30, 2022

v0.30.6 now available with the fix for this so you can now upgrade, thanks for reporting.

@Xheldon
Copy link

Xheldon commented Jan 4, 2023

OK, I debugging this file node_modules/sharp/lib/libvips.js and find that the isRosetta function return true, becase the code spawnSync('sysctl sysctl.proc_translated', spawnSyncOptions).stdout; return sysctl.proc_translated: 1:

node debugger

console log when debugger

But when I copy that code and run in my console, it shows: sysctl.proc_translated: 0:

code run in console

Shall I try the arm64 version's node?

@Xheldon
Copy link

Xheldon commented Jan 4, 2023

Finally, I update the node version to arm64, and everything works fine!

what did i do:

confirm the platform:

arch

there output arm64

then nvm install stable

It will install the 19.3.0 in my machine, and then use it as default.

After that, rerun npm i sharp, and you will got the Sharp that could deal with HEIC format image!

Xheldon added a commit to Xheldon/sharp that referenced this issue Jan 4, 2023
Get the real architecture of M1 Mac regardless of Rosetta to deal with HEIC image, see lovell#3239
@BasakKamil
Copy link

Hay guys! I have got this same problem but I can not fix it still!
I have got MacBook Pro 2019 with M1

Zrzut ekranu 2023-11-7 o 22 09 40

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

No branches or pull requests

4 participants