Skip to content

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

Description

@mykola-mokhnach

Possible install-time or require-time problem

You must confirm both of these before continuing.

Are you using the latest version of sharp?

  • I am using the latest version of sharp as reported by npm view sharp dist-tags.latest.

If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.

If you are using another package which depends on a version of sharp that is not the latest,
please open an issue against that package instead.

Are you using a supported runtime?

  • I am using Node.js with a version that satisfies ^18.17.0 || ^20.3.0 || >=21.0.0
  • I am using Deno
  • I am using Bun

If you cannot confirm any of these,
please upgrade to the latest version
and try again before opening an issue.

Are you using a supported package manager and installing optional dependencies?

  • I am using npm >= 9.6.5 with --include=optional
  • I am using yarn >= 3.2.0
  • I am using pnpm >= 7.1.0 with --no-optional=false
  • I am using Deno
  • I am using Bun

If you cannot confirm any of these, please upgrade to the latest version of your chosen package manager
and ensure you are allowing the installation of optional or multi-platform dependencies before opening an issue.

What is the complete output of running npm install --verbose --foreground-scripts sharp in an empty directory?

Details

What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?

Unfortunately I cannot provide the output above as the script is running as part of CI job. Although this is the output we get after bumping sharp version to 0.33.1:

     Uncaught Error: Could not load the "sharp" module using the linux-x64 runtime
ERR_DLOPEN_FAILED: libvips-cpp.so.42: cannot open shared object file: No such file or directory
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
    npm install --force @img/sharp-linux-x64
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
      at Object.<anonymous> (/home/runner/work/appium/appium/node_modules/sharp/lib/sharp.js:107:9)
      at Module._compile (node:internal/modules/cjs/loader:1376:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
      at Object.require.extensions.<computed> [as .js] (/home/runner/work/appium/appium/node_modules/ts-node/src/index.ts:1608:43)
      at Module.load (node:internal/modules/cjs/loader:1207:32)
      at Function.Module._load (node:internal/modules/cjs/loader:1023:12)
      at Module.require (node:internal/modules/cjs/loader:1235:19)
      at require (node:internal/modules/helpers:176:18)
      at Object.<anonymous> (/home/runner/work/appium/appium/node_modules/sharp/lib/constructor.js:10:1)
      at Module._compile (node:internal/modules/cjs/loader:1376:14)

The link to the CI job: appium/appium#19547

Exactly the same CI script worked completely fine with version 0.33.0, so it seems like there is some regression in v. 0.33.1

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions