Clearing Phoenix npm cache on Heroku
I recently encountered an issue where the solution, as found on the internet, was to remove all the npm_modules, re-install them and build again. My issue however was on Heroku rather than local.
If you're using Elixier and Phoenix on Heroku then you're likely using the heroku-buildpack-phoenix-static. This buildpack compiles the static assets for Phoenix.
This buildpack caches npm_modules by default, to clear the cache you must provide a configuration file at the root level of your project named phoenix_static_buildpack.config
that looks like:
clean_cache=true
The buildpack will now download the npm_modules on each deployment.
Tweet