dwyl / learn-heroku

:checkered_flag: Learn how to deploy your web application to Heroku from scratch step-by-step in 7 minutes!
153 stars 395 forks source link

binwrap-install: not found #26

Open Danwhy opened 5 years ago

Danwhy commented 5 years ago

While trying to deploy a new version of a Elixir/Phoenix and Elm app to heroku, I kept getting this error and failing to deploy:

remote:        > elm@0.19.0-bugfix2 install /tmp/build_aed45373ab53117201137c6bfc2c1e04/assets/node_modules/elm
remote:        > binwrap-install
remote:
remote:        sh: 1: binwrap-install: not found
remote:        npm ERR! file sh
remote:        npm ERR! code ELIFECYCLE
remote:        npm ERR! errno ENOENT
remote:        npm ERR! syscall spawn
remote:        npm ERR! elm@0.19.0-bugfix2 install: `binwrap-install`
remote:        npm ERR! spawn ENOENT
remote:        npm ERR!
remote:        npm ERR! Failed at the elm@0.19.0-bugfix2 install script.
remote:        npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I don't think it could have been caused by anything I did, as I had recently deployed the same day, and the only changes I had made were adding some csv files to the root directory. I also tried deploying other branches with only minimal changes, and got the same error.

I eventually managed to get around this error, but not in the most optimal way. Deploying the exact same branch that was failing to a brand new heroku instance worked fine, but any subsequent deployments would fail with the same error. This led me to think that the issue must be somewhere on the heroku or npm side.

I changed the version of both npm and node, and turned off the caching. I did this using the config file for the phoenix buildpack we are using (https://github.com/gjaldon/heroku-buildpack-phoenix-static):

phoenix_static_buildpack.config:

assets_path=assets
phoenix_ex=phx
node_version=9.3.0
npm_version=5.2.0
clean_cache=true

I'm not sure currently whether it's the cache or the specific npm version that fixes the error, but after doing this, I have deployed multiple updates with no problems.

edborsa commented 5 years ago

Hey @Danwhy, I am having the same issue. Any ideas on how I can solve this? I am using the same phoenix_static_buildpack.config as yours.

Regards.