Open MattArnold opened 1 year ago
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.
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.
Describe the bug Everything worked as expected, until I upgraded the MacOS version from Monterey to Ventura. Running
npm start
in iTerm2 to run the site locally outputs an error:Removing the 'node_modules/sharp' directory and running 'npm install', as directed in the error message, changes nothing.
Pushing changes to Netlify still builds the site on the web without errors.
To Reproduce Steps to reproduce the behavior:
cd
to spacebook directorynpm start
Expected behavior
npm start
builds the site with its new changes (if any), starts a server locally, and outputs a localhost address to the terminal, with which to see the changes to the site in the browser.Screenshots
Additional context MacBook Pro 16-inch, 2021, Apple M1 Max, Ventura 13.0.1 iTerm2 3.4.16 using zsh and fig