11ty / eleventy-img

Utility to perform build-time image transformations.
https://www.11ty.dev/docs/plugins/image/
436 stars 55 forks source link

Invalid sharp dependencies after eleventy-img update to 4.0.2 #218

Closed stebrech closed 6 months ago

stebrech commented 7 months ago

After updating eleventy-img from 3.1.0 to 4.0.2 I’m getting a bunch of warnings:

warning sharp@0.33.3: The engine "libvips" appears to be invalid.
warning @img/sharp-libvips-darwin-x64@1.0.2: The engine "pnpm" appears to be invalid.
warning @img/sharp-libvips-darwin-x64@1.0.2: The engine "macos" appears to be invalid.
warning @img/sharp-libvips-linux-s390x@1.0.2: The engine "pnpm" appears to be invalid.
warning @img/sharp-libvips-linux-s390x@1.0.2: The engine "glibc" appears to be invalid.
warning @img/sharp-darwin-x64@0.33.3: The engine "pnpm" appears to be invalid.
warning @img/sharp-darwin-x64@0.33.3: The engine "glibc" appears to be invalid.
warning @img/sharp-libvips-darwin-arm64@1.0.2: The engine "pnpm" appears to be invalid.
warning @img/sharp-libvips-darwin-arm64@1.0.2: The engine "macos" appears to be invalid.
warning @img/sharp-libvips-linux-arm64@1.0.2: The engine "pnpm" appears to be invalid.
warning @img/sharp-libvips-linux-arm64@1.0.2: The engine "glibc" appears to be invalid.
warning @img/sharp-libvips-linux-x64@1.0.2: The engine "pnpm" appears to be invalid.
warning @img/sharp-libvips-linux-x64@1.0.2: The engine "glibc" appears to be invalid.
warning @img/sharp-libvips-linux-arm@1.0.2: The engine "pnpm" appears to be invalid.
warning @img/sharp-libvips-linux-arm@1.0.2: The engine "glibc" appears to be invalid.
warning @img/sharp-darwin-arm64@0.33.3: The engine "pnpm" appears to be invalid.
warning @img/sharp-darwin-arm64@0.33.3: The engine "glibc" appears to be invalid.
warning @img/sharp-libvips-linuxmusl-arm64@1.0.2: The engine "pnpm" appears to be invalid.
warning @img/sharp-libvips-linuxmusl-arm64@1.0.2: The engine "musl" appears to be invalid.
warning @img/sharp-libvips-linuxmusl-x64@1.0.2: The engine "pnpm" appears to be invalid.
warning @img/sharp-libvips-linuxmusl-x64@1.0.2: The engine "musl" appears to be invalid.
warning @img/sharp-linux-arm@0.33.3: The engine "pnpm" appears to be invalid.
warning @img/sharp-linux-arm@0.33.3: The engine "glibc" appears to be invalid.
warning @img/sharp-linux-arm64@0.33.3: The engine "pnpm" appears to be invalid.
warning @img/sharp-linux-arm64@0.33.3: The engine "glibc" appears to be invalid.
warning @img/sharp-linux-x64@0.33.3: The engine "pnpm" appears to be invalid.
warning @img/sharp-linux-x64@0.33.3: The engine "glibc" appears to be invalid.
warning @img/sharp-linux-s390x@0.33.3: The engine "pnpm" appears to be invalid.
warning @img/sharp-linux-s390x@0.33.3: The engine "glibc" appears to be invalid.
warning @img/sharp-linuxmusl-arm64@0.33.3: The engine "pnpm" appears to be invalid.
warning @img/sharp-linuxmusl-arm64@0.33.3: The engine "musl" appears to be invalid.
warning @img/sharp-linuxmusl-x64@0.33.3: The engine "pnpm" appears to be invalid.
warning @img/sharp-linuxmusl-x64@0.33.3: The engine "musl" appears to be invalid.
warning @img/sharp-wasm32@0.33.3: The engine "pnpm" appears to be invalid.
warning @img/sharp-win32-ia32@0.33.3: The engine "pnpm" appears to be invalid.
warning @img/sharp-win32-x64@0.33.3: The engine "pnpm" appears to be invalid.

Trying to build 11ty there is the following error:

[11ty] 1. Error in your Eleventy config file 'eleventy.config.js'. (via EleventyConfigError)
[11ty] 2. Could not load the "sharp" module using the darwin-x64 runtime
[11ty] Possible solutions:
[11ty] - Ensure optional dependencies can be installed:
[11ty]     npm install --include=optional sharp
[11ty]     yarn add sharp --ignore-engines
[11ty] - Ensure your package manager supports multi-platform installation:
[11ty]     See https://sharp.pixelplumbing.com/install#cross-platform
[11ty] - Add platform-specific dependencies:
[11ty]     npm install --os=darwin --cpu=x64 sharp
[11ty] - Consult the installation documentation:
[11ty]     See https://sharp.pixelplumbing.com/install (via Error)
[11ty] 
[11ty] Original error stack trace: Error: Could not load the "sharp" module using the darwin-x64 runtime

Commit which includes the plugin update: https://github.com/stebrech/stebre-site/commit/a8c360fff32cfdc4455e00b98cb087ce83df6752

zachleat commented 7 months ago

Did you try any of those sharp recommendations?

lovell commented 6 months ago

https://github.com/stebrech/stebre-site/blob/ce6a3c0d486afba5c6c58c5eb7c8342046c20db7/yarn.lock#L2

yarn lockfile v1

For those who continue to use yarn v1, please see https://sharp.pixelplumbing.com/install for the additional installation option that is required, however I highly recommend you consider upgrading yarn for many reasons.

stebrech commented 6 months ago

Thanks a lot you both! @zachleat No, I haven’t tried. This probably would help as well. @lovell I switch back to npm for the moment and do not have this issue.