divriots / jampack

Optimizes static websites for best user experience and best Core Web Vitals scores.

Home Page:https://jampack.divriots.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Could not load the "sharp" module using the darwin-arm64 runtime

gpertzov opened this issue · comments

MacOs Sonoma 14.4.1 Apple Silicon
npm 10.5.0
Node.js v20.12.0

 npx @divriots/jampack ./_site
/Users/user/.npm/_npx/7fc5a6950cadcc8d/node_modules/sharp/lib/sharp.js:114
  throw new Error(help.join('\n'));
        ^

Error: Could not load the "sharp" module using the darwin-arm64 runtime
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
    yarn add sharp --ignore-engines
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=darwin --cpu=arm64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (/Users/user/.npm/_npx/7fc5a6950cadcc8d/node_modules/sharp/lib/sharp.js:114:9)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/Users/user/.npm/_npx/7fc5a6950cadcc8d/node_modules/sharp/lib/constructor.js:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)

Node.js v20.12.0

Performed suggested solutions:
npm install --include=optional sharp
npm install --os=darwin --cpu=arm64 sharp

Still getting the same error

That's a new one.

Try to install jampack globally:
npm i -g @divriots/jampack
then call jampack directly:
jampack ./_site (no npx)

Thanks for the quick reply.
Global install has solved the issue!

Deleting the .npm/_npx/7fc5a6950cadcc8d folder and re-installing via npx also seem to work.
Thanks