You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I'm trying to use a self hosted (in bitbucket) npm package. I was able to use it locally without any issues, but when running the bitbucket pipeline I get an error. It fails on the npm install step.
This is what I have on the repo using the private npm package:
...
"dependencies": {
"shared-lib": "ssh://git@bitbucket.org/{org-name}/shared-lib.git"
...
}
Both repositories are under the same organization (private) in bitbucket.
On the library that is consuming the self hosted private npm package I created a key by going to: Settings > Pipelines > SSH Keys (self generated key on bitbucket)
On the shared-lib, I have added this SSH key by going to Settings > SSH Keys > Add key (self generated).
Also added bitbucket.org as known address.
The bitbucket-pipelines.yml
at this moment does not have any special configuration, i'm only running npm install
(where it fails) and npm run test
.
This is the configuration I have, but still fails when running the pipeline.
This is the error when running the pipeline:
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@bitbucket.org/{org-name}/shared-lib.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```
Hi Luis and welcome to the community.
The most likely reason for this error is Git not being installed in the Docker image you are using in Pipelines. You can check if that's the case by adding the following command in your yml file (before the npm install command):
git --version
If Git is not installed, then:
- You can install Git during the build, before the npm install command
- Alternatively, you can use a different Docker image that already has Git pre-installed
- If you are using a custom Docker image that you own and maintain, you can add Git to this image
Please feel free to let me know how it goes and if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.