thanpolas
thanpolas

Reputation: 848

What's the best way to deploy a npmjs Private Module?

npmjs recently released their private npm modules feature which looks pretty cool.

To publish or fetch a private module from npm you need to have an authenticated npm client using npm login so the .npmrc file will get updated or created with the access token.

What is the best practice to deploy or CI an application that uses a private module?

Upvotes: 1

Views: 416

Answers (1)

linclark
linclark

Reputation: 896

The best way to do this is to include the .npmrc file but replace the auth token with an environment variable. Step 4 of this tutorial shows you how to do this and should work for any CI/deployment scenario.

If you are using Heroku, then you can follow Step 5 to set the environment variable. If not, just figure out how you configure env variables for the service you're using.

Upvotes: 2

Related Questions