Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Pipelines not working with NPM image and SSH Keys

Hello, I followed the instructions here and here to get a bitbucket pipelines yaml file set up, create a SSH key for the private repo running the build and setting that SSH key as an access token on the private repo being included in the build but I am unable to authenticate successfully. Is this a limitation with the node image or is my configuration incorrect?



# This is a sample build configuration for JavaScript.
# Check our guides at for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.15.1

- step:
- node
script: # Modify the commands below to build your repository.
- npm install
- npm test



"dependencies": {
"private-package": "git+{projectName}/{repoName}.git#v0.7.3",


npm install

+ npm install
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <\> for migration path(s).
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t{projectName}/{repoName}.git
npm ERR!
npm ERR! remote: Invalid username or password
npm ERR! fatal: Authentication failed for '{projectName}/{repoName}.git'
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-03-08T14_12_45_712Z-debug.log


repo running pipeline build Screenshot 2019-03-08 at 10.41.28.png


private repo being included in pipeline build

Screenshot 2019-03-08 at 10.42.20.png

1 answer

1 accepted

1 vote
Answer accepted
mwatson Atlassian Team Mar 12, 2019

It looks like you're using the https version of the git url - you need to go into Bitbucket and select "clone" and then select the "ssh" url and use that in your package.json.

that was the issue, it's working now. thank you!

Like Alberto Suarez - Zartis likes this

thanks so much! I am finally able to npm pull & install from pipeline.

I had another problem, if I replace the https url on package.json with a ssh one... then I wont be able to do npm install on my local computer ( access denied error )... any thoughs? thanks!! 

Try this:

"dependencies": {

  "private-package": "bitbucket:<owner>/<repo>"



Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

⭐ Calling all Bitbucket and DevOps experts: Special showcase opportunity ⭐

Hi, Bitbucket community! Are you a DevOps practitioner (or know one in your network)? Do you have DevOps tips, tricks, or learnings you'd like to share with the community? If so, we'd love to hea...

1,440 views 4 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you