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'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.
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:
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
: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.