Jump to content
Search Community

How do you get the npm private registry to work in CI/CD?

cjstage test
Moderator Tag

Recommended Posts

Hello!

 

I have bitbucket pipelines setup on my repo where I'm using gsap's private registry.  I see a CI/CD tab and have created the .npmrc file in my project root but each pipeline fails... It either says @gsap/business@latest' is not in the npm registry. or if I add npm install gsap --registry https://npm.greensock.com as a step in my pipeline then other packages in my package.json file are no longer found ( I assume because it's checking the private registry for other packages)?

 

What would be the way to set this up correctly so that it only checks the private repo for gsap packages?

Link to comment
Share on other sites

Hi,

 

Sorry to hear that you're experiencing some issues with this. Unfortunately I have zero experience with Bitbucket's CI/CD pipelines. We got in touch with the people that handles the NPM private package and they are aware of this.

 

In the mean time the only suggestion I can give you is to use a specific version in your package.json file and see if that works:

"gsap": "npm:@gsap/business@^3.11.2",

Finally, did you reached to the folks in Altassian and see if they can offer some insight about this?. I mean after all it's their CI/CD flow so who knows it better than them. I did a quick search in their forums and didn't found anything similar to this.

 

Please a little patience 🙏

 

Happy Tweening!

Link to comment
Share on other sites

Following up here.  I managed to get it working by adding - npm config set @gsap:registry https://npm.greensock.com/ to my pipeline script just before npm install.  You need the npmrc file but through researching how to get this setup it appears it's not recommended to keep your npmrc file commit so you should setup a env var and have the pipeline script generate the npmrc file when it first runs.

 

Cheers,

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 6 months later...

Hi,

 

@cjstage Thanks a lot for the help. Also to note a small detail if still not working for some - also remember to clear the previous node cache for the pipeline. 

 

Thanks a lot for the solution since it's very rare to find info on this expect for this topic!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...