lovell / sharp

High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
https://sharp.pixelplumbing.com
Apache License 2.0
28.85k stars 1.29k forks source link

gyp ERR! configure error #3220

Closed KarelJanVanHaute closed 2 years ago

KarelJanVanHaute commented 2 years ago

Possible install-time or require-time problem

Are you using the latest version of sharp?

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 [ npm verb cli '/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/node', npm verb cli '/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/npm', npm verb cli 'install', npm verb cli '--verbose', npm verb cli '--foreground-scripts', npm verb cli 'sharp' npm verb cli ] npm info using npm@8.5.5 npm info using node@v16.15.0 npm timing npm:load:whichnode Completed in 0ms npm timing config:load:defaults Completed in 1ms npm timing config:load:file:/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/npmrc Completed in 0ms npm timing config:load:builtin Completed in 0ms npm timing config:load:cli Completed in 1ms npm timing config:load:env Completed in 0ms npm timing config:load:file:/Volumes/External/TMP/BASWEB/.npmrc Completed in 0ms npm timing config:load:project Completed in 1ms npm timing config:load:file:/Users/kareljanvanhaute/.npmrc Completed in 1ms npm timing config:load:user Completed in 1ms npm timing config:load:file:/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/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 5ms npm timing npm:load:configload Completed in 5ms npm timing npm:load:setTitle Completed in 5ms npm timing config:load:flatten Completed in 1ms npm timing npm:load:display Completed in 3ms npm verb logfile /Users/kareljanvanhaute/.npm/_logs/2022-05-10T14_03_06_651Z-debug-0.log npm timing npm:load:logFile Completed in 2ms npm timing npm:load:timers Completed in 0ms npm timing npm:load:configScope Completed in 0ms npm timing npm:load Completed in 15ms npm timing arborist:ctor Completed in 0ms npm timing arborist:ctor Completed in 0ms npm timing idealTree:init Completed in 4ms npm timing idealTree:userRequests Completed in 1ms npm http fetch GET 200 https://registry.npmjs.org/sharp 148ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/color 58ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/tar-fs 90ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/simple-get 108ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/node-addon-api 109ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 112ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/tunnel-agent 118ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/semver 119ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/detect-libc 167ms (cache revalidated) npm timing idealTree:#root Completed in 321ms npm http fetch GET 200 https://registry.npmjs.org/minimist 53ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/simple-concat 52ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic 60ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/github-from-package 62ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/color-convert 67ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/rc 66ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/decompress-response 67ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/node-abi 71ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/tar-stream 81ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/chownr 101ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/safe-buffer 100ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/pump 108ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/once 113ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/color-string 117ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/lru-cache 116ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils 120ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/expand-template 121ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/npmlog 120ms (cache updated) npm timing idealTree:node_modules/sharp Completed in 133ms npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle 40ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/color-name 51ms (cache revalidated) npm timing idealTree:node_modules/color Completed in 52ms npm timing idealTree:node_modules/color-convert Completed in 1ms npm timing idealTree:node_modules/color-name Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/is-arrayish 38ms (cache revalidated) npm timing idealTree:node_modules/color-string Completed in 39ms 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/console-control-strings 39ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/deep-extend 39ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments 44ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/are-we-there-yet 47ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/set-blocking 53ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/end-of-stream 54ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/ini 54ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/gauge 75ms (cache updated) npm timing idealTree:node_modules/prebuild-install Completed in 81ms 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/signal-exit 44ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/aproba 45ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/readable-stream 47ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/delegates 50ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/strip-ansi 49ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/object-assign 53ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/string-width 53ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/has-unicode 58ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/wide-align 58ms (cache revalidated) npm timing idealTree:node_modules/npmlog Completed in 63ms npm http fetch GET 200 https://registry.npmjs.org/process-nextick-args 47ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/core-util-is 48ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/isarray 59ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/inherits 61ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/util-deprecate 63ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/string_decoder 85ms (cache revalidated) npm timing idealTree:node_modules/are-we-there-yet Completed in 87ms 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/ansi-regex 57ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point 61ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/code-point-at 61ms (cache updated) npm timing idealTree:node_modules/gauge Completed in 65ms 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 62ms (cache revalidated) npm timing idealTree:node_modules/pump Completed in 64ms npm timing idealTree:node_modules/end-of-stream Completed in 0ms npm timing idealTree:node_modules/once Completed in 1ms npm timing idealTree:node_modules/rc Completed in 1ms 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 3ms 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 53ms (cache revalidated) npm timing idealTree:node_modules/semver Completed in 55ms 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 65ms (cache revalidated) npm timing idealTree:node_modules/simple-get Completed in 66ms npm timing idealTree:node_modules/decompress-response Completed in 1ms 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 1ms 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 48ms (cache revalidated) npm timing idealTree:node_modules/string-width Completed in 52ms npm timing idealTree:node_modules/code-point-at Completed in 0ms npm timing idealTree:node_modules/is-fullwidth-code-point Completed in 2ms 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/bl 49ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/fs-constants 60ms (cache miss) npm timing idealTree:node_modules/tar-fs Completed in 63ms npm timing idealTree:node_modules/chownr Completed in 0ms npm http fetch GET 200 https://registry.npmjs.org/buffer 57ms (cache revalidated) npm timing idealTree:node_modules/tar-stream Completed in 62ms npm http fetch GET 200 https://registry.npmjs.org/base64-js 38ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/ieee754 54ms (cache updated) npm timing idealTree:node_modules/bl Completed in 57ms npm timing idealTree:node_modules/buffer Completed in 1ms 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 1280ms npm timing idealTree:fixDepFlags Completed in 1ms npm timing idealTree Completed in 1287ms npm timing reify:loadTrees Completed in 1288ms npm timing reify:diffTrees Completed in 1ms npm timing reify:retireShallow Completed in 0ms npm timing reify:createSparse Completed in 5ms npm timing reify:loadBundles Completed in 0ms npm timing reifyNode:node_modules/is-fullwidth-code-point Completed in 73ms npm timing reifyNode:node_modules/ansi-regex Completed in 73ms npm timing reifyNode:node_modules/chownr Completed in 74ms npm timing reifyNode:node_modules/code-point-at Completed in 74ms npm timing reifyNode:node_modules/process-nextick-args Completed in 73ms npm timing reifyNode:node_modules/strip-json-comments Completed in 73ms npm timing reifyNode:node_modules/once Completed in 73ms npm timing reifyNode:node_modules/strip-ansi Completed in 73ms npm timing reifyNode:node_modules/wrappy Completed in 73ms npm timing reifyNode:node_modules/string-width Completed in 74ms npm timing reifyNode:node_modules/ini Completed in 74ms npm timing reifyNode:node_modules/object-assign Completed in 74ms npm timing reifyNode:node_modules/aproba Completed in 74ms npm timing reifyNode:node_modules/wide-align Completed in 74ms npm timing reifyNode:node_modules/has-unicode Completed in 74ms npm timing reifyNode:node_modules/end-of-stream Completed in 74ms npm timing reifyNode:node_modules/color-name Completed in 73ms npm timing reifyNode:node_modules/color-string Completed in 73ms npm timing reifyNode:node_modules/simple-swizzle Completed in 74ms npm timing reifyNode:node_modules/fs-constants Completed in 77ms npm timing reifyNode:node_modules/ieee754 Completed in 77ms npm timing reifyNode:node_modules/mimic-response Completed in 77ms npm timing reifyNode:node_modules/number-is-nan Completed in 77ms npm timing reifyNode:node_modules/decompress-response Completed in 76ms npm timing reifyNode:node_modules/core-util-is Completed in 76ms npm timing reifyNode:node_modules/inherits Completed in 77ms npm timing reifyNode:node_modules/lru-cache Completed in 77ms npm timing reifyNode:node_modules/signal-exit Completed in 77ms npm timing reifyNode:node_modules/set-blocking Completed in 77ms npm timing reifyNode:node_modules/console-control-strings Completed in 77ms npm timing reifyNode:node_modules/tunnel-agent Completed in 76ms npm timing reifyNode:node_modules/color Completed in 77ms npm timing reifyNode:node_modules/base64-js Completed in 79ms npm timing reifyNode:node_modules/util-deprecate Completed in 78ms npm timing reifyNode:node_modules/yallist Completed in 78ms npm timing reifyNode:node_modules/safe-buffer Completed in 81ms npm timing reifyNode:node_modules/deep-extend Completed in 81ms npm timing reifyNode:node_modules/pump Completed in 81ms npm timing reifyNode:node_modules/npmlog Completed in 81ms npm timing reifyNode:node_modules/string_decoder Completed in 82ms npm timing reifyNode:node_modules/is-arrayish Completed in 83ms npm timing reifyNode:node_modules/isarray Completed in 82ms npm timing reifyNode:node_modules/delegates Completed in 83ms npm timing reifyNode:node_modules/color-convert Completed in 82ms npm timing reifyNode:node_modules/detect-libc Completed in 82ms npm timing reifyNode:node_modules/are-we-there-yet Completed in 83ms npm timing reifyNode:node_modules/simple-get Completed in 84ms npm timing reifyNode:node_modules/buffer Completed in 86ms npm timing reifyNode:node_modules/rc Completed in 86ms npm timing reifyNode:node_modules/bl Completed in 87ms npm timing reifyNode:node_modules/prebuild-install Completed in 86ms npm timing reifyNode:node_modules/node-abi Completed in 88ms npm timing reifyNode:node_modules/gauge Completed in 90ms npm timing reifyNode:node_modules/minimist Completed in 90ms npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz 73ms (cache miss) npm timing reifyNode:node_modules/mkdirp-classic Completed in 92ms npm http fetch GET 200 https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz 78ms (cache miss) npm timing reifyNode:node_modules/simple-concat Completed in 96ms npm http fetch GET 200 https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz 82ms (cache miss) npm timing reifyNode:node_modules/tar-stream Completed in 98ms npm timing reifyNode:node_modules/readable-stream Completed in 100ms npm http fetch GET 200 https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz 77ms (cache miss) npm timing reifyNode:node_modules/github-from-package Completed in 101ms npm timing reifyNode:node_modules/tar-stream/node_modules/readable-stream Completed in 103ms npm timing reifyNode:node_modules/bl/node_modules/readable-stream Completed in 103ms npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz 85ms (cache miss) npm timing reifyNode:node_modules/napi-build-utils Completed in 104ms npm timing reifyNode:node_modules/node-addon-api Completed in 103ms npm timing reifyNode:node_modules/semver Completed in 104ms npm timing reifyNode:node_modules/sharp Completed in 106ms npm http fetch GET 200 https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz 82ms (cache miss) npm timing reifyNode:node_modules/tar-fs Completed in 109ms npm http fetch GET 200 https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz 97ms (cache miss) npm timing reifyNode:node_modules/expand-template Completed in 118ms npm timing reify:unpack Completed in 120ms npm timing reify:unretire Completed in 0ms npm timing build:queue Completed in 1ms npm timing build:link:node_modules/prebuild-install Completed in 1ms npm timing build:link:node_modules/rc Completed in 1ms npm timing build:link:node_modules/semver Completed in 1ms npm timing build:link Completed in 1ms npm info run sharp@0.30.4 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.4 install > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 243ms npm timing auditReport:getReport Completed in 247ms npm timing auditReport:init Completed in 0ms npm timing reify:audit Completed in 247ms sharp: Detected globally-installed libvips v8.12.2ng reify:audit Completed in 247ms sharp: Building from source via node-gyp gyp info it worked if it ends with okemplate: timing reify:audit Completed in 247ms gyp verb cli [ gyp verb cli '/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/node', gyp verb cli '/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js', gyp verb cli 'rebuild' gyp verb cli ] gyp info using node-gyp@9.0.0 gyp info using node@16.15.0 | darwin | arm64 gyp verb command rebuild [] gyp verb command clean [] gyp verb clean removing "build" directory gyp verb command configure [] gyp verb find Python Python is not set from command line or npm configuration gyp verb find Python Python is not set from environment variable PYTHON gyp verb find Python checking if "python3" can be used gyp verb find Python - executing "python3" to get executable path gyp verb find Python - executable path is "/usr/local/opt/python@3.9/bin/python3.9" gyp verb find Python - executing "/usr/local/opt/python@3.9/bin/python3.9" to get version gyp verb find Python - version is "3.9.12"te: timing reify:audit Completed in 247ms gyp info find Python using Python version 3.9.12 found at "/usr/local/opt/python@3.9/bin/python3.9" gyp verb get node dir no --target version specified, falling back to host node version: 16.15.0 gyp verb command install [ '16.15.0' ] gyp verb install input version string "16.15.0"iming reify:audit Completed in 247ms gyp verb install installing version: 16.15.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: 16.15.0 gyp verb build dir attempting to create "build" dir: /Volumes/External/TMP/BASWEB/node_modules/sharp/build gyp verb build dir "build" dir needed to be created? Yes gyp verb build/config.gypi creating config file gyp verb build/config.gypi writing out config file: /Volumes/External/TMP/BASWEB/node_modules/sharp/build/config.gypi gyp verb config.gypi checking for gypi file: /Volumes/External/TMP/BASWEB/node_modules/sharp/config.gypi gyp verb common.gypi checking for gypi file: /Volumes/External/TMP/BASWEB/node_modules/sharp/common.gypi gyp verb gyp gyp format was not specified; forcing "make" gyp info spawn /usr/local/opt/python@3.9/bin/python3.9 gyp info spawn args [ gyp info spawn args '/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/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 '/Volumes/External/TMP/BASWEB/node_modules/sharp/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/kareljanvanhaute/Library/Caches/node-gyp/16.15.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/kareljanvanhaute/Library/Caches/node-gyp/16.15.0', gyp info spawn args '-Dnode_gyp_dir=/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/Users/kareljanvanhaute/Library/Caches/node-gyp/16.15.0/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/Volumes/External/TMP/BASWEB/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 ] Package xproto was not found in the pkg-config search path.audit Completed in 247ms Perhaps you should add the directory containing `xproto.pc' to the PKG_CONFIG_PATH environment variable Package 'xproto', required by 'xau', not found gyp: Call to 'PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/12:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:/usr/local/libdata/pkgconfig:/usr/libdata/pkgconfig" pkg-config --cflags-only-I vips-cpp vips glib-2.0 | sed s\/-I//g' returned exit status 0 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:261:16) gyp ERR! stack at ChildProcess.emit (node:events:527:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) gyp ERR! System Darwin 21.4.0 gyp ERR! command "/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/node" "/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Volumes/External/TMP/BASWEB/node_modules/sharp gyp ERR! node -v v16.15.0 gyp ERR! node-gyp -v v9.0.0 gyp ERR! not ok npm info run sharp@0.30.4 install { code: 1, signal: null } npm timing reify:rollback:createSparse Completed in 19ms npm timing reify:rollback:retireShallow Completed in 0ms npm timing command:install Completed in 7578ms npm verb stack Error: command failed npm verb stack at ChildProcess. (/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27) npm verb stack at ChildProcess.emit (node:events:527:28) npm verb stack at maybeClose (node:internal/child_process:1092:16) npm verb stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) npm verb pkgid sharp@0.30.4 npm verb cwd /Volumes/External/TMP/BASWEB npm verb Darwin 21.4.0 npm verb argv "/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/node" "/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/npm" "install" "--verbose" "--foreground-scripts" "sharp" npm verb node v16.15.0 npm verb npm v8.5.5 npm ERR! code 1 npm ERR! path /Volumes/External/TMP/BASWEB/node_modules/sharp npm ERR! command failed npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) npm verb exit 1 npm timing npm Completed in 7683ms npm verb unfinished npm timer reify 1652191386755 npm verb unfinished npm timer reify:build 1652191388178 npm verb unfinished npm timer build 1652191388179 npm verb unfinished npm timer build:deps 1652191388179 npm verb unfinished npm timer build:run:install 1652191388181 npm verb unfinished npm timer build:run:install:node_modules/sharp 1652191388181 npm verb code 1 npm ERR! A complete log of this run can be found in: npm ERR! /Users/kareljanvanhaute/.npm/_logs/2022-05-10T14_03_06_651Z-debug-0.log

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

System: OS: macOS 12.3.1 CPU: (8) arm64 Apple M1 Memory: 178.61 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm

lovell commented 2 years ago

Hi, it looks like you're attempting to compile sharp from source against a globally-installed libvips:

sharp: Detected globally-installed libvips v8.12.2 sharp: Building from source via node-gyp

The salient part of this error log is:

Package xproto was not found in the pkg-config search path

This suggests there's probably something wrong with your homebrew installation of pkg-config itself, unrelated to sharp or libvips.

Please try running brew update && brew upgrade to fix any homebrew-related problems.

KarelJanVanHaute commented 2 years ago

I did a brew update && brew upgrade and I reinstalled pkg-config and the vips. But to no avail. Still getting the same error.

lovell commented 2 years ago

Thanks, this still looks like a Homebrew dependency problem - perhaps run brew install xorgproto if its missing.

Alternatively, if you don't need to use the brew-installed libvips, run brew remove vips then re-install sharp and it will use its own prebuilt binaries.

KarelJanVanHaute commented 2 years ago

When I remove the vips in brew. I get the following error.

error /Volumes/External/GIT/BASWEB/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
Arguments: 
Directory: /Volumes/External/GIT/BASWEB/node_modules/sharp
Output:
sharp: Using cached /Users/kareljanvanhaute/.npm/_libvips/libvips-8.10.6-darwin-arm64v8.tar.br
prebuild-install WARN install No prebuilt binaries found (target=3 runtime=napi arch=arm64 libc= platform=darwin)
gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@16.15.0 | darwin | arm64
gyp info find Python using Python version 3.9.12 found at "/usr/local/opt/python@3.9/bin/python3.9"
gyp info spawn /usr/local/opt/python@3.9/bin/python3.9
gyp info spawn args [
gyp info spawn args   '/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/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   '/Volumes/External/GIT/BASWEB/node_modules/sharp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kareljanvanhaute/Library/Caches/node-gyp/16.15.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/kareljanvanhaute/Library/Caches/node-gyp/16.15.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/kareljanvanhaute/Library/Caches/node-gyp/16.15.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Volumes/External/GIT/BASWEB/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 info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
  LIBTOOL-STATIC Release/nothing.a
Usage: /Applications/MAMP/Library/bin/libtool [OPTION]... [MODE-ARG]...
Try 'libtool --help' for more information.
libtool:   error: unrecognised option: '-static'
make: *** [Release/nothing.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.4.0
gyp ERR! command "/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/node" "/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Volumes/External/GIT/BASWEB/node_modules/sharp

And here the full output from where the errors start

``` gyp verb command build []ify:typescript: info run ttf2woff2@2.0.3 install node_modules/ttf2woff2 (node-gyp rebuild > builderror.log) || (exit 0) gyp verb build type Release gyp verb architecture arm64 gyp verb node dev dir /Users/kareljanvanhaute/.node-gyp/16.15.0 gyp verb `which` succeeded for `make` /usr/bin/make gyp info spawn make gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ] In file included from ../csrc/addon.cc:1:info run ttf2woff2@2.0.3 install node_modules/ttf2woff2 (node-gyp rebuild > builderror.log) || (exit 0) In file included from ../../nan/nan.h:56: In file included from /Users/kareljanvanhaute/.node-gyp/16.15.0/include/node/node.h:63: In file included from /Users/kareljanvanhaute/.node-gyp/16.15.0/include/node/v8.h:30: /Users/kareljanvanhaute/.node-gyp/16.15.0/include/node/v8-internal.h:492:38: error: no template named 'remove_cv_t' in namespace 'std'; did you mean 'remove_cv'? !std::is_same>::value>::Perform(data); ~~~~~^~~~~~~~~~~ remove_cv /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:715:50: note: 'remove_cv' declared here template struct _LIBCPP_TEMPLATE_VIS remove_cv ^ ../csrc/addon.cc:10:49: error: too few arguments to function call, single argument 'context' was not specifieduild > builderror.log) || (exit 0) Local inputBuffer = info[0]->ToObject(); ~~~~~~~~~~~~~~~~~ ^ /Users/kareljanvanhaute/.node-gyp/16.15.0/include/node/v8.h:3060:44: note: 'ToObject' declared here V8_WARN_UNUSED_RESULT MaybeLocal ToObject( ^ ../csrc/addon.cc:10:17: error: no viable conversion from 'MaybeLocal' to 'Local' Local inputBuffer = info[0]->ToObject(); ^ ~~~~~~~~~~~~~~~~~~~ /Users/kareljanvanhaute/.node-gyp/16.15.0/include/node/v8.h:200:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'MaybeLocal' to 'const v8::Local &' for 1st argument class Local { ^ /Users/kareljanvanhaute/.node-gyp/16.15.0/include/node/v8.h:200:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'MaybeLocal' to 'v8::Local &&' for 1st argument /Users/kareljanvanhaute/.node-gyp/16.15.0/include/node/v8.h:204:13: note: candidate template ignored: could not match 'Local' against 'MaybeLocal' V8_INLINE Local(Local that) ^ /Users/kareljanvanhaute/.node-gyp/16.15.0/include/node/v8.h:348:22: note: explicit constructor is not a candidate explicit V8_INLINE Local(T* that) : val_(that) {} ^ 3 errors generated. make: *** [Release/obj.target/addon/csrc/addon.o] Error 1 gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Volumes/External/GIT/BASWEB/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (node:events:527:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) gyp ERR! System Darwin 21.4.0 gyp ERR! command "/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/node" "/Volumes/External/GIT/BASWEB/node_modules/.bin/node-gyp" "rebuild" gyp ERR! cwd /Volumes/External/GIT/BASWEB/node_modules/ttf2woff2 gyp ERR! node -v v16.15.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm info run ttf2woff2@2.0.3 install { code: 0, signal: null } npm timing build:run:install:node_modules/ttf2woff2 Completed in 904ms npm info run sharp@0.28.3 install node_modules/favicons/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.28.3 install > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) sharp: Using cached /Users/kareljanvanhaute/.npm/_libvips/libvips-8.10.6-darwin-arm64v8.tar.brode_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node inst prebuild-install info begin Prebuild-install version 6.1.328.3 install node_modules/favicons/node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node inst prebuild-install info looking for local prebuild @ prebuilds/sharp-v0.28.3-napi-v3-darwin-arm64.tar.gz prebuild-install info looking for cached prebuild @ /Users/kareljanvanhaute/.npm/_prebuilds/260fb3-sharp-v0.28.3-napi-v3-darwin-arm64.tar.gz prebuild-install http request GET https://github.com/lovell/sharp/releases/download/v0.28.3/sharp-v0.28.3-napi-v3-darwin-arm64.tar.gz prebuild-install http 404 https://github.com/lovell/sharp/releases/download/v0.28.3/sharp-v0.28.3-napi-v3-darwin-arm64.tar.gz/libvips && node install/dll-copy && prebuild-install) || (node inst prebuild-install WARN install No prebuilt binaries found (target=3 runtime=napi arch=arm64 libc= platform=darwin) gyp info it worked if it ends with okpt: info run sharp@0.28.3 install node_modules/favicons/node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node inst gyp verb cli [ gyp verb cli '/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/node', gyp verb cli '/Volumes/External/GIT/BASWEB/node_modules/.bin/node-gyp', gyp verb cli 'rebuild' gyp verb cli ] gyp info using node-gyp@3.8.0 gyp info using node@16.15.0 | darwin | arm64 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 "python2" in the PATH gyp verb `which` succeeded python2 /Applications/MAMP/Library/bin/python2 gyp verb check python version `/Applications/MAMP/Library/bin/python2 -c "import sys; print "2.7.18 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: 16.15.0 gyp verb command install [ '16.15.0' ] gyp verb install input version string "16.15.0"un sharp@0.28.3 install node_modules/favicons/node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node inst gyp verb install installing version: 16.15.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: 16.15.0 gyp verb build dir attempting to create "build" dir: /Volumes/External/GIT/BASWEB/node_modules/favicons/node_modules/sharp/build gyp verb build dir "build" dir needed to be created? /Volumes/External/GIT/BASWEB/node_modules/favicons/node_modules/sharp/build gyp verb build/config.gypi creating config file gyp verb build/config.gypi writing out config file: /Volumes/External/GIT/BASWEB/node_modules/favicons/node_modules/sharp/build/config.gypi (node:74366) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only. (Use `node --trace-deprecation ...` to show where the warning was created) gyp verb config.gypi checking for gypi file: /Volumes/External/GIT/BASWEB/node_modules/favicons/node_modules/sharp/config.gypi gyp verb common.gypi checking for gypi file: /Volumes/External/GIT/BASWEB/node_modules/favicons/node_modules/sharp/common.gypi gyp verb gyp gyp format was not specified; forcing "make" gyp info spawn /Applications/MAMP/Library/bin/python2 gyp info spawn args [ gyp info spawn args '/Volumes/External/GIT/BASWEB/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 '/Volumes/External/GIT/BASWEB/node_modules/favicons/node_modules/sharp/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/Volumes/External/GIT/BASWEB/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/kareljanvanhaute/.node-gyp/16.15.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/kareljanvanhaute/.node-gyp/16.15.0', gyp info spawn args '-Dnode_gyp_dir=/Volumes/External/GIT/BASWEB/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/Users/kareljanvanhaute/.node-gyp/16.15.0/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/Volumes/External/GIT/BASWEB/node_modules/favicons/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 []ify:typescript: info run sharp@0.28.3 install node_modules/favicons/node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node inst gyp verb build type Release gyp verb architecture arm64 gyp verb node dev dir /Users/kareljanvanhaute/.node-gyp/16.15.0 gyp verb `which` succeeded for `make` /usr/bin/make gyp info spawn make gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ] cc '-DNODE_GYP_MODULE_NAME=nothing' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' -I/Users/kareljanvanhaute/.node-gyp/16.15.0/include/node -I/Users/kareljanvanhaute/.node-gyp/16.15.0/src -I/Users/kareljanvanhaute/.node-gyp/16.15.0/deps/openssl/config -I/Users/kareljanvanhaute/.node-gyp/16.15.0/deps/openssl/openssl/include -I/Users/kareljanvanhaute/.node-gyp/16.15.0/deps/uv/include -I/Users/kareljanvanhaute/.node-gyp/16.15.0/deps/zlib -I/Users/kareljanvanhaute/.node-gyp/16.15.0/deps/v8/include -O3 -gdwarf-2 -mmacosx-version-min=10.13 -arch arm64 -Wall -Wendif-labels -W -Wno-unused-parameter -fno-strict-aliasing -MMD -MF ./Release/.deps/Release/obj.target/nothing/../node-addon-api/nothing.o.d.raw -c -o Release/obj.target/nothing/../node-addon-api/nothing.o ../../node-addon-api/nothing.c rm -f Release/nothing.a && ./gyp-mac-tool filter-libtool libtool -static -o Release/nothing.a Release/obj.target/nothing/../node-addon-api/nothing.oll-copy && prebuild-install) || (node inst Usage: /Applications/MAMP/Library/bin/libtool [OPTION]... [MODE-ARG]...node_modules/favicons/node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node inst Try 'libtool --help' for more information. libtool: error: unrecognised option: '-static'n sharp@0.28.3 install node_modules/favicons/node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node inst make: *** [Release/nothing.a] Error 1 gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Volumes/External/GIT/BASWEB/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (node:events:527:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) gyp ERR! System Darwin 21.4.0 gyp ERR! command "/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/node" "/Volumes/External/GIT/BASWEB/node_modules/.bin/node-gyp" "rebuild" gyp ERR! cwd /Volumes/External/GIT/BASWEB/node_modules/favicons/node_modules/sharp gyp ERR! node -v v16.15.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm info run sharp@0.28.3 install { code: 1, signal: null } npm timing reify:rollback:createSparse Completed in 28057ms npm timing reify:rollback:retireShallow Completed in 0ms npm timing command:install Completed in 75335ms npm verb stack Error: command failed npm verb stack at ChildProcess. (/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27) npm verb stack at ChildProcess.emit (node:events:527:28) npm verb stack at maybeClose (node:internal/child_process:1092:16) npm verb stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) npm verb pkgid sharp@0.28.3 npm verb cwd /Volumes/External/GIT/BASWEB npm verb Darwin 21.4.0 npm verb argv "/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/node" "/Users/kareljanvanhaute/.nvm/versions/node/v16.15.0/bin/npm" "install" "--verbose" "--foreground-scripts" "sharp" npm verb node v16.15.0 npm verb npm v8.5.5 npm ERR! code 1 npm ERR! path /Volumes/External/GIT/BASWEB/node_modules/favicons/node_modules/sharp npm ERR! command failed npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) npm verb exit 1 npm timing npm Completed in 75448ms npm verb unfinished npm timer reify 1652266114852 npm verb unfinished npm timer reify:build 1652266153749 npm verb unfinished npm timer build 1652266153751 npm verb unfinished npm timer build:deps 1652266153751 npm verb unfinished npm timer build:run:install 1652266153811 npm verb unfinished npm timer build:run:install:node_modules/favicons/node_modules/sharp 1652266156941 npm verb code 1 npm ERR! A complete log of this run can be found in: npm ERR! /Users/kareljanvanhaute/.npm/_logs/2022-05-11T10_48_34_742Z-debug-0.log ```
lovell commented 2 years ago

https://sharp.pixelplumbing.com/install#apple-m1 says

Prebuilt sharp and libvips binaries have been provided for macOS on ARM64 since sharp v0.29.0.

The log you've provided looks like it's an attempt to install sharp v0.28.x - please upgrade.

KarelJanVanHaute commented 2 years ago

@lovell thank you very much for your time. I used sharp in another plugin which used indeed 0.28.0. I now forced it to use the latest version. Now it works again.

For future reference, my steps:

  • yarn cache clean (don't know if this was necessary)
  • changed the yarn.lock file, so it points to v0.30.4 instead of v0.28.0.
  • And then runned the installation again. And now it works.

The code I changed in the yarn.lock file:

favicons@^6.2.2:
  version "6.2.2"
  resolved "https://registry.npmjs.org/favicons/-/favicons-6.2.2.tgz"
  integrity sha512-qhvFqbhlXA/JYIDYuxTrE4uT9rcpTCrWvF3UG0GxBoLl/XgFBBTrZkQvASrkMebSwDCJ9kKGypRWIbvoRZLBsw==
  dependencies:
    clone "^2.1.2"
    colors "^1.4.0"
    image-size "^0.8.3"
    jimp "^0.16.1"
    jsontoxml "^1.0.1"
    lodash.defaultsdeep "^4.6.1"
    require-directory "^2.1.1"
    sharp "^0.30.4"
    through2 "^4.0.2"
    tinycolor2 "^1.4.2"
    to-ico "^1.1.5"
    vinyl "^2.2.1"
    xml2js "^0.4.23"

It's a bit weird it crashes because it had sharp "^0.28.0" so shouldn't it use 0.30.4 in that case on install?

lovell commented 2 years ago

Specifying a semver range of ^0.28.0 will use 0.28.3 as that's the most recent version on the 0.28.x line.

https://semver.npmjs.com/

danielricecodes commented 1 year ago

Alternatively, if you don't need to use the brew-installed libvips, run brew remove vips then re-install sharp and it will use its own prebuilt binaries.

Removing vips worked! Wow!

mario-gazzara commented 8 months ago

Alternatively, if you don't need to use the brew-installed libvips, run brew remove vips then re-install sharp and it will use its own prebuilt binaries.

Removing vips worked! Wow!

Worked for me too! Thanks