79307435

Date: 2024-12-25 11:11:29
Score: 1
Natty:
Report link

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"]

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Zilal