Skip to content

NPM install stucks with node:20 #1946

Open
@riethmue

Description

@riethmue

Environment

  • Platform: MacOS Ventura (13.4.1) on M1
  • Docker Version: 24.0.5
  • Node.js Version: 20
  • Image Tag: 20

Expected Behavior

NPM install should be started. I've tested this with node:18 image instead and it works. node:20-slim stucks too.

Current Behavior

NPM install does not start and stucks.

[test] docker build --progress=plain --platform linux/amd64 -t test-image .     9:52:01 
#0 building with "desktop-linux" instance using docker driver

#1 [internal] load .dockerignore
#1 transferring context: 66B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 414B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/node:20
#3 DONE 1.3s

#4 [1/5] FROM docker.io/library/node:20@sha256:64b71834718b859ea389790ae56e5f2f8fa9456bf3821ff75fa28a87a09cbc09
#4 CACHED

#5 [2/5] WORKDIR /usr/src/app
#5 DONE 0.0s

#6 [internal] load build context
#6 transferring context: 1.12kB 0.0s done
#6 DONE 0.0s

#7 [3/5] COPY package*.json ./
#7 DONE 0.0s

#8 [4/5] RUN npm install

I've tried other npm commands like npm cache clean --force but those stuck too.

Possible Solution

Steps to Reproduce

I'm using the docker file from official nodejs example :

FROM node:20

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install
# If you are building your code for production
# RUN npm ci --omit=dev

# Bundle app source
COPY . .

EXPOSE 8080
CMD [ "node", "server.js" ]

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions