heroku / heroku-buildpack-nodejs

Heroku's buildpack for Node.js applications.
https://devcenter.heroku.com/articles/buildpacks
MIT License
1.31k stars 2.63k forks source link

Document using private repos #174

Closed hunterloftis closed 4 years ago

hunterloftis commented 9 years ago

(in all the forms - private npm repo, private github / bitbucket repo...)

aseemk commented 9 years ago

+1

abtris commented 9 years ago

+1

I have problems how setup credentials for npm private registry without add credentials into git repository.

kevinohara80 commented 9 years ago

@abtris

You'll want to commit an .npmrc file to your repo that loads your token from environment variables. Here is the example .npmrc

@myregistry:registry=http://myregistry.com:8080/
//myregistry.com:8080/:_authToken=${NPM_TOKEN}

Then just set your environment variable...

$ heroku config:set NPM_TOKEN=<your token>
hunterloftis commented 9 years ago

You folks are awesome. Thanks @kevinohara80!

ianwremmel commented 7 years ago

Note that this solution makes local development inconvenient. see https://github.com/heroku/heroku-buildpack-nodejs/issues/363 for more details.

peteruithoven commented 7 years ago

The following article with the matching buildpacks seem relevant: http://zeke.sikelianos.com/npm-and-github-automation-with-heroku/

In the end it didn't work with zeke's buildpack, but I did get it working with the one from Tim Shadel: https://github.com/timshadel/heroku-buildpack-github-netrc

This way you use 2 buildpacks (I'm not sure if order matters), heroku-buildpack-github-netrc and the official heroku/nodejs buildpack and, you set the GITHUB_AUTH_TOKEN environment variable and then dependencies from github just work. Even the regular github:<githubname>/<githubrepo>[#<commit-ish>] syntax.

Would be awesome to get this included by default in the offical heroku/nodejs. This one of the most painful things I had to deal with in regards to Heroku.

danielleadams commented 4 years ago

Documented here: https://devcenter.heroku.com/articles/nodejs-support#private-dependencies