My problem is solved by: 1- updating react-script by
npm update react-scripts --save 2-Delete package-lock.json 3- delete node_modules 4- npm install After that: Delete node_modules inside Dockerfile I used this for npm install RUN npm install -g [email protected]
All in all, you need to update all versions (npm, nodeJs, create-react) and mentioned the version of npm in Dockerfile. My whole Dockerfile is: FROM node:22.12.0-alpine
WORKDIR /home/node/app
COPY package.json package-lock.json ./
RUN npm install -g [email protected]
COPY . ./
EXPOSE 3000
CMD ["npm", "start"]