#Error: Could not load the "sharp" module using the linux-x64 runtime

1 messages · Page 1 of 1 (latest)

vast socket
#

Hi!

I followed the guide on
https://immich.app/docs/developer/setup

But when I "only want to do web development connected to an existing, remote backend", the step
IMMICH_SERVER_URL=https://demo.immich.app/ npm run dev
results into

vboxuser@ubuntults:/sharedfolders/git/immich/web$ IMMICH_SERVER_URL=https://demo.immich.app/ npm run dev

[email protected] dev
vite dev --host 0.0.0.0 --port 3000

failed to load config from /sharedfolders/git/immich/web/vite.config.js
error when starting dev server:
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> (/sharedfolders/git/immich/web/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> (/sharedfolders/git/immich/web/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)
spring prismBOT
#

:wave: Hey @vast socket,

Thanks for reaching out to us. Please follow the recommended actions below; this will help us be more effective in our support effort and leave more time for building Immich immich.

References

Checklist

  1. :blue_square: I have verified I'm on the latest release(note that mobile app releases may take some time).
  2. :blue_square: I have read applicable release notes.
  3. :blue_square: I have reviewed the FAQs for known issues.
  4. :blue_square: I have reviewed Github for known issues.
  5. :blue_square: I have tried accessing Immich via local ip (without a custom reverse proxy).
  6. :blue_square: I have uploaded the relevant logs, docker compose, and .env files using the buttons below or the /upload command.
  7. :blue_square: I have tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable

(an item can be marked as "complete" by reacting with the appropriate number)

If this ticket can be closed you can use the /close command, and re-open it later if needed.

vast socket
#

The issue roots in using an old npm version.

I called npm install --verbose --foreground-scripts --os=linux --cpu=x64 sharp
There was not a single module pull, e.g. npm http fetch GET 200 ...
Explicitly tried to pull npm install --verbose --foreground-scripts --os=linux --cpu=x64 "@img/sharp-linux-x64"
Which resulted into an error:

npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: @img/[email protected]
npm ERR! notsup Not compatible with your version of node/npm: @img/[email protected]
npm ERR! notsup Required: {"node":"^18.17.0 || ^20.3.0 || >=21.0.0","npm":">=9.6.5","yarn":">=3.2.0","pnpm":">=7.1.0","glibc":">=2.26"}
npm ERR! notsup Actual:   {"npm":"9.2.0"}```
🤬 🤦 

--->>> Resolved by updating to
```vboxuser@ubuntults:~$ npm -v
10.7.0
vboxuser@ubuntults:~$ node -v
v20.14.0```
#

This can be closed, for some future help seeker