next-image-export-optimizer icon indicating copy to clipboard operation
next-image-export-optimizer copied to clipboard

Could not load sharp module error

Open longgtruong opened this issue 1 year ago • 1 comments

Hi i'm currently getting this error while building the static site "next-image-export-optimizer": 1.12.2

/home/runner/work/opendeur-monorepo/opendeur-monorepo/node_modules/next-image-export-optimizer/node_modules/sharp/lib/sharp.js:114
  throw new Error(help.join('\n'));
  ^

Error: Could not load the "sharp" module using the linux-x64 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=linux --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (/home/runner/work/opendeur-monorepo/opendeur-monorepo/node_modules/next-image-export-optimizer/node_modules/sharp/lib/sharp.js:114:9)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:1197:32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/home/runner/work/opendeur-monorepo/opendeur-monorepo/node_modules/next-image-export-optimizer/node_modules/sharp/lib/constructor.js:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1356:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)

Node.js v18.19.0

longgtruong avatar Feb 12 '24 11:02 longgtruong

Ultimately, locking sharp to 0.32 resolved the issue for us.

Possibly related issue: lovell/sharp#3994

joshuabaker avatar May 01 '24 17:05 joshuabaker

Hi @joshuabaker @longgtruong,

I just published a new version where I updated sharp to the latest version. Please reopen this issue, when the problem persists.

Niels-IO avatar May 26 '24 10:05 Niels-IO