首页 > 解决方案 > npm ci 不适用于 bitbucket 管道?

问题描述

我有一个 react-native 项目,我正在尝试使用 bitbucket 管道来运行测试并导出到 expo。

为此,我尝试遵循本文,但失败并显示以下输出:

+ 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

问题是,npm ci 在我的本地机器上正常工作。

我缺乏想法。有什么帮助吗?

标签: bitbucket-pipelinesnpm-ci

解决方案


我设法使用'node'图像而不是'node:alpine'解决了这个问题。

也许 ssh 默认没有安装在 node:alpine 上?

任何进一步的解释将不胜感激:)


推荐阅读