Is it possible to login to an NPM account for private repositories with cloud build?


I have some private repositories and was wondering if it was possible to still use cloud build whilst targeting those by providing NPM credentials somehow?

I know that pretty much repeats the title, but not sure how much more one can elaborate!

Many thanks,


Yes, it is possible.

You have to create a .npmrc file in your project root. and that should contain a link to your private repo with access.
For example, if I was using gem fury, i would put something like this in .npmrc

registry =<API KEY>/<Proj Name>/


Hi thank you so much for that reply, helped me a great deal!

As I’m not using a private repository and rather private packages at NPM, the line I needed in my .npmrc file turned out to be:


More info here:

Thanks again, really helped.