【发布时间】:2019-12-11 08:26:03
【问题描述】:
我正在从我的私人存储库安装一个包。我可以使用以下方法安装它:
npm i -S git+https://oauth2:XXXXXXX@gitlab.com/mygroup/acl-api.git
我正在使用 docker 容器,但在安装过程中出现错误:
npm ERR! path git
npm ERR! code ENOENT
npm ERR! errno ENOENT
npm ERR! syscall spawn git
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t https://oauth2:XXXXXXX@gitlab.com/mygroup/acl-api.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
我该如何解决?
我的 docker 文件:
FROM node:alpine
COPY package.json package.json
COPY src src
COPY .babelrc .babelrc
RUN npm install
RUN npm run gitlab-build
RUN ls
EXPOSE 8080
CMD ["npm", "run", "docker-start"]
【问题讨论】:
-
您能否提供完整的
dockerfile以及您使用的任何 docker 命令。 -
@mchawre 当然,对不起。
-
看起来从
node:alpine到node的迁移(docker)解决了一个问题。
标签: docker npm npm-install