Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to install private NPM package in a different repository pipeline

Anders Ervik
April 20, 2026

I'm trying to use the new private NPM registry feature in Pipelines. 

The docs show how to create the package in the repository and publish the package from the repository's Pipelines using  .npmrc with $BITBUCKET_PACKAGES_USERNAME and $ENCODED_PACKAGES_TOKEN. This all works.

Next, how do I install that package from a Pipeline in another repository? If I setup a Pipeline with a .npmrc using that repository's $BITBUCKET_PACKAGES_USERNAME and $ENCODED_PACKAGES_TOKEN, it doesnt work:

npm error code E404
npm error 404 Not Found - GET https://npm.apkg.io/workspace/@scope%2fpackage - package @scope/package does not exist or you may not have sufficient permission.
npm error 404
npm error 404 '@scope/package@^1.0.10' is not in this registry.

Admittedly, this matches the documentation: the token is scoped to the current repository, not the repository where the package was published. But is there another way to install a package from a private Bitbucket Packages NPM registry in a Bitbucket Pipeline of another repository without configuring a personal token?

 

1 answer

1 accepted

0 votes
Answer accepted
Ben
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 21, 2026

Hi @Anders Ervik 

You will need to create and use a personal API token to access the registry. If you use this token instead of the $ENCODED_PACKAGES_TOKEN - you can work with any package that's in the workspace vs just the repository-scoped packages:

For now, you'll need to use an Atlassian API token (ideally from a service account) as a secured variable, because the built-in Pipeline tokens won't work cross-repo. There is a workspace-accessible packages feature which is currently in the works, so this is a workaround until this is implemented.

Hope this helps, please let me know if you have any further questions.

Cheers!

- Ben (Bitbucket Cloud Support)

Anders Ervik
April 21, 2026

Thanks Ben, personal API token works for now. I'm eagerly awaiting the workspace-accessible packages feature.

Like Ricardo Navarro likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events