If you're experiencing that kind of error message when trying to install something related with NodeJS in docker container, you should try that trick, in your Dockerfile adds that command:
ENV NODE_OPTIONS="--dns-result-order=ipv4first"
See my Dockerfile:
FROM node:18.15.0
ENV NODE_OPTIONS="--dns-result-order=ipv4first"
RUN npm install -g @nestjs/cli
I hope it helps you in some way.
Top comments (0)