@dsheets@dylanrhysscott I’m on beta 21 and still getting trouble during npm install. It’s random and the terminal seems to freeze for a while, and then I get a docker engine error.
Other thing I tested and makes the problem happen almost always, is mounting the npm cache folder to the container.
@robsondantas are you on Beta 21 (build 11019)? There was a Beta 21 hotfix that corrected several issues. If you are on build 11019, could you please post a reproduction (if it happens even 50% of the time, that’s fine) of the issue? Also, could you please post the specific docker engine error?
@dsheets on 1.12.1 build 121333 and was building my development machine again. Same problem. Looks like when there is a huge amount of IO, the problem happens.
Using node:4.4.7 image, mounting a volume and executing npm install through docker. A piece of the console output:
npm info attempt registry request try #1 at 12:07:27 AM
npm http fetch GET https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz
npm info build /data/adm-inyo/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/combined-stream
npm info build /data/adm-inyo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-build/node_modules/download/node_modules/request/node_modules/combined-stream
npm http fetch 200 escape-string-regexp-1.0.4.tgz
npm http fetch 200 has-ansi-2.0.0.tgz
npm http fetch 200 ansi-styles-2.1.0.tgz
npm http fetch 200 supports-color-2.0.0.tgz
npm http fetch 200 strip-ansi-3.0.0.tgz
npm info install cryptiles@0.2.2
npm info preinstall sntp@0.2.4
npm info build /data/adm-inyo/node_modules/grunt-contrib-imagemin/node_modules/optipng-bin/node_modules/bin-wrapper/node_modules/download/node_modules/request/node_modules/combined-stream
npm info build /data/adm-inyo/node_modules/grunt-contrib-imagemin/node_modules/jpegtran-bin/node_modules/bin-build/node_modules/download/node_modules/request/node_modules/combined-stream
npm info build /data/adm-inyo/node_modules/grunt-contrib-imagemin/node_modules/gifsicle/node_modules/bin-build/node_modules/download/node_modules/request/node_modules/combined-stream
npm info build (freezes here for a while)
ERROR: Bad response from Docker engine
same issue in the last docker release :
docker version
Client:
Version: 18.03.1-ce
API version: 1.37
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:17:20 2018
OS/Arch: linux/amd64
Experimental: false
Orchestrator: swarm
Server:
Engine:
Version: 18.03.1-ce
API version: 1.37 (minimum version 1.12)
Go version: go1.9.5
Git commit: 9ee9f40
Built: Thu Apr 26 07:15:30 2018
OS/Arch: linux/amd64
Experimental: false
UPDATE: npm install within docker build works for me now.
IT WAS MY FAULT.
One of my dependencies was a private gitlab server requiring SSH access, e.g. git+ssh://git@gitlab.private.com:group/repo.git
Removing the dependency fixed things. I could have also invested the effort to install ssh and keys.
Original post:
and now in 2019…
Dockerfile
from node:12-alpine
COPY . .
RUN npm install --quiet
Sending build context to Docker daemon 2.489MB
Step 1/3 : from node:12-alpine
—> d4edda39fb81
Step 2/3 : COPY . .
—> 1d17b2ea3329
Step 3/3 : RUN npm install
—> Running in bced46202613
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://npm.community
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-06-21T04_04_48_619Z-debug.log
The command ‘/bin/sh -c npm install’ returned a non-zero code: 1