Strange Git Error on Docker NPM Install Strange Git Error on Docker NPM Install docker docker

Strange Git Error on Docker NPM Install


One reason for this could be that you are using the slim version of node in your Dockerfile:

FROM node:8-slim

I presume this does not include git, because when I changed to the full version the error went away:

FROM node:8.11.2


Try the following:

RUN apk update && \    apk add --update git && \    apk add --update openssh

The git binary within the docker container becomes available at /usr/bin/git


I had the same issue. It was due to lack of git. Below is how it worked

FROM node:alpineRUN apk add gitRUN npm install ...