If you want to run PhantomJS on a NodeJS Heroku project, you may have seen the dreaded error:
phantomjs-node: You don't have 'phantomjs' installed
Apparently, all I had to do was ensure my PhantomJS buildpack came before the NodeJS buildpack. Using the command line, run:
heroku buildpacks:add --index 1 https://github.com/stomita/heroku-buildpack-phantomjs.git
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-nodejs
The --index 1
flag puts the PhantomJS buildpack in the first position. The last buildpack in the list is the one that Heroku uses to boot your app. Any other buildpacks that your app eventually rely on must go first in that list.