奇怪的Git错误在Docker NPM安装

我有一个工作的Dockerfile,直到一天前它似乎中断。 我没有做任何改变我的依赖 – 但我得到以下错误:

[91mnpm ERR! code ENOGIT [0m [91mnpm ERR! No git binary found in $PATH npm ERR! npm[0m [91m ERR! Failed using git. npm ERR! Please check if you have git installed and in your PATH. [0m [91m npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2017-09-28T21_12_50_050Z-debug.log [0m Removing intermediate container be9d5bfe5521 The command '/bin/sh -c npm install' returned a non-zero code: 1 

这是非常奇怪的,因为这没有发生过。 我也附上我的Dockerfile。 到目前为止,我试过的东西是添加git(第三行),并试图导出path。 似乎没有任何工作。

 FROM ubuntu:latest RUN apt-get update RUN apt-get install -y git FROM node:alpine RUN npm install sails -g #RUN npm install git -g #RUN export PATH="$HOME/usr/bin/git:$PATH" RUN mkdir -p /service/app WORKDIR /service/app COPY package.json /service/app RUN npm install COPY . /service/app EXPOSE 80 CMD NODE_ENV=production sails lift