Heroku buildpack for modifying the .npmrc file based on .env variables
- On the settings page for your app, e.g. https://dashboard.heroku.com/apps/MY-APP/settings, find the
Buildpackssection. - Click on the 'Add buildpack' button.
- Provide the URL for this repository:
https://github.com/LambdaSchool/heroku-buildpack-npmrc.git - Click 'Save Changes'
- Verify that this build pack is used before the
heroku/nodejsbuild pack.- If you have already added
heroku/nodejs, use the UI to re-order the build packs so thatheroku-buildpack-npmrccomes first. - If you haven't added
heroku/nodejs, add it now. It should be placed afterheroku-buildpack-npmrc.
- If you have already added
While still on the settings page, add an environment variable NPM_TOKEN=00000000-0000-0000-0000-000000000000. When this variable is present, it will be inserted into the .npmrc file like so: //registry.npmjs.org/:_authToken=00000000-0000-0000-0000-000000000000