Skip to content

withDouble/buildpack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

heroku-buildpack-npmrc

A Heroku buildpack for overriding the .npmrc file in the build directory with the contents of a config var. Useful for authorizing with npm when installing private packages.

Configure Multiple Buildpacks

Option 1: Heroku CLI or Dashboard

Add the buildpack to your Heroku app either using the CLI or the Heroku dashboard. The heroku-buildpack-npmrc needs to run before any buildpack using npm. In the following example, it runs before the heroku/nodejs buildpack.

$ heroku buildpacks:set --index 1 https://github.com/debitoor/heroku-buildpack-npmrc.git
$ heroku buildpacks:add heroku/nodejs

Option 2: Use heroku-buildpack-multi

Instead of setting the buildpacks directly with Heroku they can also be configured using a .buildpacks in combination with heroku-buildpack-multi.

$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi.git  

The same example given for the CLI use would have the following .buildpacks file.

$ cat .buildpacks
https://github.com/debitoor/heroku-buildpack-npmrc.git
https://github.com/heroku/heroku-buildpack-nodejs.git

Configure Config Var

Add the NPMRC config var in Heroku with the contents of your .npmrc file.

 $ heroku config:set NPMRC=//registry.npmjs.org/:_authToken=00000000-0000-0000-0000-000000000000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%