Towards the end of the image building process, it fails on npm run build
with this long Esbuild error (I only copied part of it).
ERROR [web client 6/6] RUN npm run build
CANCELED [build 4/5] COPY . .
[client 6/6] RUN npm run build:
my-app-frontend@0.0.0 build
ng build
❯ Building...
✖ Building... [FAILED:
You installed esbuild for 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-x64" package is present but this platform
needs the "@esbuild/linux-x64" 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 of npm which has built-in support for installing a package on multiple
platforms simultaneously.
...
There are 7 more paragraphs of this with all the same information. I do not have Esbuild in my package.json though it is in my package-lock.json as a dependency. I even tried including a bit of code that deletes node_modules though it should be unnecessary. My node_modules folder is in docker.ignore. How do I move past this error and deploy?