Bug description
On my local, I get the following error after taking the screenshot with Argos 2.0.1:
Error: Could not load the "sharp" module using the linux-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=linux --cpu=arm64 sharp
- Consult the installation documentation:
See https://sharp.pixelplumbing.com/install
at Object.<anonymous> (/app/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 Object.require.extensions.<computed> [as .js] (/root/.cache/Cypress/13.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:851:20)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Function.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> (/app/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)
at Object.require.extensions.<computed> [as .js] (/root/.cache/Cypress/13.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:851:20)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Function.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> (/app/node_modules/sharp/lib/index.js:6:15)
at Module._compile (node:internal/modules/cjs/loader:1369:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
at Object.require.extensions.<computed> [as .js] (/root/.cache/Cypress/13.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:851:20)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Function.Module._load (node:internal/modules/cjs/loader:1022:12)
at cjsLoader (node:internal/modules/esm/translators:366:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:315:7)
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
at async Object.exports.upload (/app/node_modules/@argos-ci/core/dist/index.cjs:3:24)
at async Object.handler (/app/node_modules/@argos-ci/cypress/dist/task.cjs:27:21)
On CI, I'm getting the following error after taking the screenshot with Argos 2.0.1:
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> (/app/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 Object.require.extensions.<computed> [as .js] (/root/.cache/Cypress/13.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:851:20)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Function.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> (/app/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)
at Object.require.extensions.<computed> [as .js] (/root/.cache/Cypress/13.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:851:20)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Function.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> (/app/node_modules/sharp/lib/index.js:6:15)
at Module._compile (node:internal/modules/cjs/loader:1369:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
at Object.require.extensions.<computed> [as .js] (/root/.cache/Cypress/13.8.1/Cypress/resources/app/node_modules/ts-node/dist/index.js:851:20)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Function.Module._load (node:internal/modules/cjs/loader:1022:12)
Correct behavior expected
The sharp library should not fail.
Wrong behavior observed
The sharp library failed to be loaded apparently because of the OS, however, everything looks fine, we are using the official Cypress image and I tried with the official Node Image either.
Reproduce
I'm not sure, but I have assumptions this is related to the incompatibility with Cypress or Node docker images
Setup
OS: MacOS M2 Pro
Docker Desktop Version: 4.29.0
Cypress Official Image: 13.8.1
Argos Version: 2.0.1
Yarn Version: 4.1.1
Node Version: v20.12.2
On CI everything is the same, except the OS, we are using CircleCI and the OS is ubuntu-2204:2024.01.1