Closed jsmestad closed 4 years ago
Thanks for the PR @jsmestad! :purple_heart:
@gjaldon We are getting reports from customers with the following error
remote: cat: /tmp/env/NPM_TOKEN: No such file or directory
It seems like it may be related to this pull request. Do you mind if I revert this for now while I investigate further?
Looking a bit closer, I think this is definitely causing the issue. I'm going to go ahead and revert. @jsmestad do you mind modifying this pull request to make sure the /tmp/env/NPM_TOKEN exists before reading it and fall back to original behavior if it and the env var does not exist?
Background
When
clear_cache
is enabled and the deploy is adding private packages (requiring an.npmrc
file) the deploy will fail. This is due to thenpm prune
command missing the same--userconfig
flag.While I was in there, I integrated
NPM_TOKEN
support to generate an.npmrc
like other buildpacks on Heroku support out-of-the-box.Feedback
I think I can refactor the generation code to use the ENV exports method from common.sh, but was not sure so I went with the safest option.