首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >安装Docker NPM时出现奇怪的Git错误

安装Docker NPM时出现奇怪的Git错误
EN

Stack Overflow用户
提问于 2017-09-29 05:31:21
回答 3查看 3.2K关注 0票数 4

我有一个可以工作的Dockerfile,直到一天前它看起来好像坏了。我没有对我的依赖项做任何更改--但是我得到了以下错误:

代码语言:javascript
复制
[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 (第三行),并尝试导出路径。似乎什么都不起作用。

代码语言:javascript
复制
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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46478626

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档