11ty / eleventy-base-blog

A starter repository for a blog web site using the Eleventy static site generator.

Home Page:https://eleventy-base-blog.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not install and run on M1 Mac?

MattWilcox opened this issue · comments

Entirely possible I'm doing something wrong, but here's what I did:

  • Clone this repo
  • cd into it
  • npm install
  • npx @11ty/eleventy

This fails, with the output:

npx @11ty/eleventy
[11ty] Eleventy CLI Fatal Error: (more in DEBUG output)
[11ty] 1. Error in your Eleventy config file 'eleventy.config.js'. You may need to run `npm install`. (via EleventyConfigError)
[11ty] 2. Something went wrong installing the "sharp" module
[11ty] 
[11ty] Cannot find module '../build/Release/sharp-darwin-arm64v8.node'

Info

node --version
v18.13.0

npm --version
8.19.3

OSX 12.6.2 (Monterey), M1 Mac

Interesting, worked for me on my M1 Max; although I've had issues w/ Sharp in the past and might have brew installed some libraries in the past.

https://sharp.pixelplumbing.com/install#apple-m1 implies it "should work"

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

npm ls sharp
eleventy-base-blog@8.0.0 /private/tmp/11ty-base-blog
└─┬ @11ty/eleventy-img@2.0.1
  └── sharp@0.30.7

Does npm i sharp -D work for you locally?


UPDATE: Might also be relevant issues over in https://github.com/11ty/eleventy-img/issues?q=sharp+is%3Aissue land.

I just deleted the node_modules and package-lock.json, then re-tried... and it worked.

Odd. I wouldn't think you'd need to delete node_modules if it was a fresh clone, unless package-lock.json is somehow suspicious.

Yep, it's a weird one. Don't know quite how npm works, but maybe the source module was missing or corrupt when I initially tried. Thanks for the help, by the way!

I did just push a new Eleventy Image v3.0.0 and bumped the version on eleventy-base-blog about 10 minutes ago, just FYI