I ran into a problem where Heroku would not install node dependencies specified in
package.json. Specifically, I was getting the message:
Running: rake assets:precompile
cd webpack && $(npm bin)/webpack --config webpack.rails.config.js
sh: /tmp/build_bf971752-54a9-4b3e-9b22-b6f1f7f8f5e7/node_modules/.bin/webpack: not found
Command failed with status (127): [cd webpack && $(npm bin)/webpack --config …]
(more about the issue here)
I have a project that depends on Node and GSL.
This is handled by the contents of file: /.buildpacks, which contains:
https://github.com/heroku/heroku-buildpack-nodejs.git https://github.com/nolman/heroku-gsl-buildpack.git https://github.com/heroku/heroku-buildpack-ruby.git
It’s critical to use this buildpack loader allows env variables to go from one buildpack to the next: https://github.com/nolman/heroku-buildpack-multi
You have to set this with:
heroku config:set BUILDPACK_URL="https://github.com/nolman/heroku-buildpack-multi"
I had problems with the Heroku deploy caching, so I had to run these commands to clear the cache:
heroku plugins:install https://github.com/heroku/heroku-repo.git heroku repo:purge_cache -a <my-app>
Note, when updating
package.json, it’s critical to run
and to then commit
Or else Heroku won’t update the npm packages!