简体   繁体   English

npm ci 不在 bitbucket 管道上工作?

[英]npm ci not working on bitbucket pipeline?

I have a react-native project and I'm trying to use bitbucket pipeline to run the tests and export to expo.我有一个 react-native 项目,我正在尝试使用 bitbucket 管道来运行测试并导出到 expo。

For that I tried to follow this article , but it fail with the following output :为此,我尝试按照本文进行操作,但失败并显示以下输出:

+ npm ci
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 ssh://git@github.com/expo/react-native-maps.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 
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-03-06T00_28_01_570Z-debug.log

The thing is, npm ci works properly on my local machine.问题是,npm ci 在我的本地机器上正常工作。

I'm short of ideas.我缺乏想法。 Any help ?有什么帮助吗?

I managed to work around the problem using 'node' image instead of 'node:alpine'.我设法使用“节点”图像而不是“节点:高山”解决了这个问题。

Maybe ssh not installed by default on node:alpine ?也许默认情况下没有在 node:alpine 上安装 ssh ?

Any further explanation would be appreciated :)任何进一步的解释将不胜感激:)

I experienced a similar error, the only difference being that I was using the https URL instead of the SSH URL, on a node:10-alpine image.我遇到了类似的错误,唯一的区别是我在node:10-alpine图像上使用了https URL 而不是 SSH URL。

To fix the issue, I installed git using apk add git before running npm install .为了解决这个问题,我在运行npm install之前使用apk add git安装了 git。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM