X Tutup
The Wayback Machine - https://web.archive.org/web/20200917220534/https://github.com/nodejs/docker-node/issues/1236
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install leads to error in latest alpine image #1236

Open
kleinph opened this issue Mar 30, 2020 · 5 comments
Open

npm install leads to error in latest alpine image #1236

kleinph opened this issue Mar 30, 2020 · 5 comments

Comments

@kleinph
Copy link

@kleinph kleinph commented Mar 30, 2020

Dockerfile:

FROM node:13.12.0-alpine AS build
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

If I run docker build it always exits with npm ERR! cb() never called!
After chaning the image to 12.16.0-alpine it works. Also not including package-lock.json fixes this problem.

The npm *-debug.log file contains nothing useful:

<-- snip downloading and extracting -->
19581 timing npm Completed in 95032ms
19582 error cb() never called!
19583 error This is an error with npm itself. Please report this error at:
19584 error <https://npm.community>

The JS app I try to dockerize here is a freshly generated Angular app.

@LaurentGoderre
Copy link
Contributor

@LaurentGoderre LaurentGoderre commented Mar 30, 2020

This doesn't seem to be an issue with the image but with the install scripts for one of the dependencies failing. Perhaps one of your dependencies relies on node binding that don't support Alpine linux?

@kleinph
Copy link
Author

@kleinph kleinph commented Mar 30, 2020

But it's supported on the previous version alpine image.

How can I find out which dependency?

@PeterDaveHello
Copy link
Member

@PeterDaveHello PeterDaveHello commented Apr 8, 2020

Does this error also exist in different variants of 13.12.0 image?

@kleinph
Copy link
Author

@kleinph kleinph commented Apr 17, 2020

Strangely this issue seems to not occur anymore. I successfully built it with node:13.12.0-alpine, node:13.12.0-slim and node:13.12.0 images with --no-cache and --pull flags.

@Agalin
Copy link

@Agalin Agalin commented May 28, 2020

It may be related to slow network connection. It's failing randomly on my system using node:13.8-alpine. Yesterday everything built, today exactly the same dockerfile fails.
When I try to reproduce it manually in the container then first try fails and second or third one succeeds. npm cache clean --force - and it fails again.

And on CI where connection is a bit more stable and faster it seems to never fail with this error.

Edit.
Literally chaining a few npm ci calls makes my dockerfile pass...
RUN npm ci --production || npm ci --production || npm ci --production
But it works exactly the same for node:13.8 so it's rather an npm issue than alpine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.
X Tutup