Coder Social home page Coder Social logo

Comments (2)

imacrayon avatar imacrayon commented on July 29, 2024

Try deleting package-lock.json and node_modules and then do an npm install. I’ve run into situations like this where things get cached in the lock file.

from spacebook.

MattArnold avatar MattArnold commented on July 29, 2024

tldr: Update the version of @11ty/eleventy-img.

Having deleted package-lock.json and 'node_modules, running npm install` threw a bunch of errors, including:

npm ERR! ERR! sharp Prebuilt libvips 8.10.0 binaries are not yet available for darwin-arm64v8
npm ERR! info sharp Attempting to build from source via node-gyp but this may fail due to the above error
npm ERR! info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies

Going to the website from that link showed me:

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

package.json does not seem to contain sharp; presumably this is because prebuilt binaries are not Javascript packages. Apparently sharp is included in spacebook through the eleventy-plugin-lazyimages package, in which the Sharp dependency was updated to "sharp": ">=0.29.3" in November 2021 which is later than 0.29.0.

The lazysizes and markdown-it-image-lazysizes dependencies do not seem to bring in sharp, so that's probably not the issue.

Now we come to 11ty/eleventy-img. As soon as I deleted that line from package.json, I was able to npm install without throwing an error. My site started building locally as soon as I went into eleventy.js, commented out const Image = require("@11ty/eleventy-img");, and changed let metadata = await Image( etc to `let metadata = {}'.

I put eleventy.js back the way it was, changed "@11ty/eleventy-img": "^0.5.0", to "@11ty/eleventy-img": "^=2.0.1", in package.json, and the site seems to work well.

from spacebook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.