Solution for npm ERR! enoent undefined ls-remote -h -t
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -2
npm ERR! enoent Error while executing
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
In DevOps, when run under node alpine docker image, you probably will get this error. The error here is in this line:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
The right one should be
npm ERR! enoent git ls-remote -h -t ssh://git@github.com/eligrey/FileSaver.js.git
This means Git is undefined. I
f you add the following line to the docker file:
RUN git --version
💡💡The solution could be install Git by adding this line
RUN apk add --no-cache git
RUN git --version