bitbucket-pipelinesnpm-ci

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.

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.

I'm short of ideas. Any help ?


Solution

  • 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.

    To fix the issue, I installed git using apk add git before running npm install.