nodejs / docker-node

Official Docker Image for Node.js :whale: :turtle: :rocket:
https://hub.docker.com/_/node/
MIT License
8.26k stars 1.97k forks source link

The recent updates may be causing issues #2153

Open GabrielBragaGit opened 2 weeks ago

GabrielBragaGit commented 2 weeks ago

I’ve been having trouble building my projects using the latest Docker images for Node.js. The recent updates seem to be causing issues—I can only successfully build with images from earlier dates. Previously, I relied on node:22-alpine, but after the most recent update, it’s no longer working for me. Any insights or fixes?

'npm ci' get stuck like this:

=> [builder 4/6] RUN npm ci --verbose                                                               616.5s

 => => # npm info using npm@10.9.0
 => => # npm info using node@v22.10.0 
 => => # npm verbose title npm ci
 => => # npm verbose argv "ci" "--loglevel" "verbose"
 => => # npm verbose logfile logs-max:10 dir:/home/node/.npm/_logs/2024-10-18T06_09_00_687Z-
 => => # npm verbose logfile /home/node/.npm/_logs/2024-10-18T06_09_00_687Z-debug-0.log

When I try node:lts-alpine3.20 it works as always worked on node:22-alpine.

P.S. After trying a million alternatives, what magically resolved for me was swapping npm for yarn.

benjylxwang commented 2 weeks ago

I'm getting this as well, it seems to work on image tag node:22.9-alpine

pharindoko commented 2 weeks ago

I'm getting this as well, it seems to work on image tag node:22.9-alpine

yes the issue started with node: 22.10.0

I can`t do an npm install anymore

switching back to node:22.9.0-alpine solved it.

Zysberg commented 1 week ago

made a dummy repo that replicates this problem here

leighghunt commented 6 days ago

Still seems present in v22.11.0 - the following hangs for 10 mins+ (until cancelling).

npm verbose cli /usr/local/bin/node /usr/local/bin/npm
npm info using npm@10.9.0
npm info using node@v22.11.0
npm verbose title npm ci
npm verbose argv "ci" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:/root/.npm/_logs/2024-10-31T20_59_05_818Z-
npm verbose logfile /root/.npm/_logs/2024-10-31T20_59_05_818Z-debug-0.log

As per https://github.com/nodejs/docker-node/issues/2153#issuecomment-2422380608 switching from FROM node:lts AS development to FROM node:22.9.0-alpine AS development resolves the issue.

os-a2 commented 4 days ago

i'm building my image with node:lts-bullseye-slim and for some reason running RUN npm config set loglevel verbose before RUN npm ci --legacy-peer-deps fixed it for me.