I ran my container for the first time and I got the following error message. I’m trying to distinguish if this a docker issue or it’s an issue that my dev team have to resolve. If this is a docker issue how do I resolve it?
Docker file configuration:
COPY . /app
RUN npm install
RUN $(npm bin)/cypress verify
RUN $(npm bin)/cypress
You installed esbuild on another platform than the one you’re currently using.
This won’t work because esbuild is written with native code and needs to
install a platform-specific binary executable.
Specifically the “esbuild-darwin-arm64” package is present but this platform
needs the “esbuild-linux-arm64” package instead. People often get into this
situation by installing esbuild on Windows or macOS and copying “node_modules”
into a Docker image that runs Linux, or by copying “node_modules” between
Windows and WSL environments.
If you are installing with npm, you can try not copying the “node_modules”
directory when you copy the files over, and running “npm ci” or “npm install”
on the destination platform after the copy. Or you could consider using yarn
instead which has built-in support for installing a package on multiple
If you are installing with yarn, you can try listing both this platform and the
other platform in your “.yarnrc.yml” file using the “supportedArchitectures”
Keep in mind that this means multiple copies of esbuild will be present.
Another alternative is to use the “esbuild-wasm” package instead, which works
the same way on all platforms. But it comes with a heavy performance cost and
can sometimes be 10x slower than the “esbuild” package, so you may also not
want to do that.
at generateBinPath (/e2e/node_modules/esbuild/lib/main.js:1815:17) at esbuildCommandAndArgs (/e2e/node_modules/esbuild/lib/main.js:1901:31) at ensureServiceIsRunning (/e2e/node_modules/esbuild/lib/main.js:2065:25) at Object.build (/e2e/node_modules/esbuild/lib/main.js:1956:26) at bundleOnce (/e2e/node_modules/@bahmutov/cypress-esbuild-preprocessor/src/index.js:24:6) at Object.cypressESBuildFilePreprocessor [as handler] (/e2e/node_modules/@bahmutov/cypress-esbuild-preprocessor/src/index.js:61:14) at invoke (/root/.cache/Cypress/10.4.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:43:18) at /root/.cache/Cypress/10.4.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:59:14 at tryCatcher (/root/.cache/Cypress/10.4.0/Cypress/resources/app/node_modules/@packages/server/node_modules/bluebird/js/release/util.js:16:23) at Function.Promise.attempt.Promise.try (/root/.cache/Cypress/10.4.0/Cypress/resources/app/node_modules/@packages/server/node_modules/bluebird/js/release/method.js:39:29) at Object.wrapChildPromise (/root/.cache/Cypress/10.4.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:58:23) at Object.wrap (/root/.cache/Cypress/10.4.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/preprocessor.js:47:8)
at RunPlugins.execute (/root/.cache/Cypress/10.4.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:152:29) at EventEmitter.<anonymous> (/root/.cache/Cypress/10.4.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:257:12) at EventEmitter.emit (node:events:526:28) at process.<anonymous> (/root/.cache/Cypress/10.4.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22) at process.emit (node:events:526:28) at emit (node:internal/child_process:938:14) at processTicksAndRejections (node:internal/process/task_queues:84:21)