What I Wanted to Do
npm install when building a Docker image
What Happened Instead
Had a syntax error in the Dockerfile and
npm hanged and brought everything to a halt. I would have expected
npm to exit with an error code.
I had something like this in my
FROM node:11.13.0-alpine RUN npm install --global foo \ COPY . /foo/bar
This is a syntax error due to the backslash at the end of the first line. This is what I see when I run
npm ERR! code ENOLOCAL npm ERR! Could not install from "" as it does not contain a package.json file.
and everything hangs right there. I would have expected an error exit, not hanging.