Report this

What is the reason for this report?

Private NPM repository credentials on DO App platform

Posted on November 15, 2022

I have a JS React app deployed on DO app platform.

I have a private repository as a dependency.

In my local setup, I do the following to authenticate:

npm set registry https://npm.FOO.com npm adduser --registry https://npm.FOO.com

When I deploy it fails to install the package due to missing authentication.

I would like to know how to add the credentials or the authentication token so that it authenticates when I deploy on the DO app platform.

Thank you for the support



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

I believe that you can define a NPM_TOKEN environment variable with your private repo token.

That should allow you to authenticate as normal.

There are a few more ways of defining your token as described here:

https://docs.npmjs.com/using-private-packages-in-a-ci-cd-workflow

Let me know how it goes!

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.