gjaldon / heroku-buildpack-phoenix-static

A Heroku buildpack for building Phoenix's static assets
MIT License
230 stars 224 forks source link

Build is failing with NPM_TOKEN issue #103

Closed cblavier closed 4 years ago

cblavier commented 4 years ago

Since today, my build is failing with following error. I don't really know why it's starting bothering me with NPM_TOKEN since we don't have any private npm dependency... 🤔

-----> Installing binaries
       clean_cache option set to true.
       Cleaning out cache contents
       Cleaning up old Node v12.12.0
Resolving node version 12.12.0...
Downloading and installing node 12.12.0...
       Installing Node 12.12.0...
       Using default npm version 6.11.3
-----> Building dependencies
       Installing node modules
cat: /tmp/d20200409-56-2gpqsi/NPM_TOKEN: No such file or directory
hubertlepicki commented 4 years ago

Same issue, I belileve the faulty code is located here: https://github.com/gjaldon/heroku-buildpack-phoenix-static/blob/497cb019a72f2ebf243327f114ea5e276eec7309/lib/build.sh#L144

hubertlepicki commented 4 years ago

So my quick investigation leads to temporary workaround:

gigalixir config:set --app_name=xxx NPM_TOKEN=""

or

heroku config:set --app=xxx NPM_TOKEN=""

depending on where you run the thing. This creates empty env variable, which then creates this missing file.

This probably should still be fixed in the buildpack but leaving this as workaround for other folks because I am just that good of a person.