Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support NPM_CONFIG_USERCONFIG environment variable #969

Open
r-thomson opened this issue Dec 29, 2021 · 0 comments
Open

Support NPM_CONFIG_USERCONFIG environment variable #969

r-thomson opened this issue Dec 29, 2021 · 0 comments

Comments

@r-thomson
Copy link

Is your enhancement request related to a problem? Please describe.
I ran into a situation recently where I wanted to use a Heroku-specific .npmrc file. My initial thought was to create a second file (.heroku.npmrc) and point NPM at it by setting the environment variable NPM_CONFIG_USERCONFIG=.heroku.npmrc. However, npm ci is run with the --userconfig flag set, which overrides that environment variable (introduced in #79).

Describe the solution you'd like
It'd be nice if the --userconfig flag was skipped if the NPM_CONFIG_USERCONFIG environment variable is present. Or, the buildpack could be changed to set NPM_CONFIG_USERCONFIG (if it's unset) instead of using the --userconfig flag.

Describe alternatives you've considered
As a workaround, I'm using a prebuild script to overwrite .npmrc with the contents of .heroku.npmrc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant