I am trying to containerise Svelte js app inside a docker container and I am getting this error on the log complaining about esbuild in a different platform , I am using M1 mac, I have tried to install esbuild-wasm
as what the log suggested and tried npm i esbuild-linux-arm64
as a step in the docker file and tried RUN npm install yarn
as the log suggested yarn as it have built-in stuff deal with the platform but it didn t work
my docker file
FROM node:16.10.0
WORKDIR /my-website
COPY package.json .
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]
the error is
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.