docker-node icon indicating copy to clipboard operation
docker-node copied to clipboard

Node 18.18 image installation errors in circleci

Open Capez opened this issue 2 years ago • 5 comments

Environment

  • Platform: Ubuntu
  • Docker Version: 19.03.13
  • Node.js Version:
  • Image Tag: node:18-bullseye-slim

Expected Behavior

Successfully running docker build with yarn install command on node base image in circleci

Current Behavior

error An unexpected error occurred: "/usr/app/node_modules/@/apollo-client/node_modules/dd-trace, /usr/app/node_modules/@/nestjs-logger/node_modules/dd-trace: Cannot read properties of undefined (reading 'config')".

An unexpected error occurred: "/root/project/node_modules/husky: Cannot read properties of undefined (reading 'config')".

Error being seen among various packages during installation

Possible Solution

Rollback changes to node:18-bullseye-slim, works on on 18.17

Steps to Reproduce

ARG NODE_IMAGE=node:18-bullseye-slim

FROM $NODE_IMAGE

ARG GITHUB_ACCESS_TOKEN=

WORKDIR /usr/app

COPY ./packages       ./packages
COPY ./src            ./src
COPY .npmrc .yarnrc package.json yarn.lock ./

RUN yarn install --frozen-lockfile --production

COPY ./public         ./public
COPY docker-entrypoint.sh tsconfig.build.json tsconfig.json ./

RUN yarn build

Additional Information

This error appeared today for images, was working fine yesterday

Capez avatar Sep 20 '23 17:09 Capez

Can you try this: https://stackoverflow.com/a/75827486

LaurentGoderre avatar Sep 20 '23 19:09 LaurentGoderre

Experiencing the same issue. We are also using node 18 in CircleCI. I'm also using dd-trace An unexpected error occurred: "/build/node_modules/dd-trace: Cannot read properties of undefined (reading 'config')".

Update: pinning to node:18-alpine3.16 solves the issue in our pipelines

rafahuaman avatar Sep 20 '23 22:09 rafahuaman

https://stackoverflow.com/a/75827486

that did not fix it

Capez avatar Sep 21 '23 16:09 Capez

Please have a pr with https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md fix in node 18

rohit-techolution avatar Sep 22 '23 10:09 rohit-techolution

Please have a pr with https://github.com/nodejs/node-gyp/blob/main/docs/Updating-npm-bundled-node-gyp.md fix in node 18

can you elaborate? we need to add this to the dockerfile for the node:18-bullseye-slim image?

Capez avatar Sep 25 '23 20:09 Capez