0

I'm getting the following error with dns during npm run build in Dockerfile.

ModuleNotFoundError: Module not found: Error: Can't resolve 'dns' in '/reactProj/node_modules/ioredis/built/cluster'

dns is configured in the package.json to point to a mock file.

    "dns": "file:./lib/__mocks__/dns",

What change should I be doing for this?

Dockerfile for ref:

FROM node:16
ENV NODE_ENV production
WORKDIR /reactProj
COPY ./package.json /reactProj
RUN npm install
COPY . .
RUN npm run build

Thanks in advance.

ayeshas7
  • 81
  • 5

1 Answers1

1

This got fixed by removing the following from Dockerfile

NODE_ENV production

npm run build command from scripts already sets the same.

ayeshas7
  • 81
  • 5