nature/pa11y — pull request #36 by whymarrh (2013-11-23 16:09:44+00:00)
Title: Friendly message if PhantomJS binary not in PATH

[The phantom-node module used expects the `phantomjs` binary to be the environment `PATH`](https://github.com/sgentle/phantomjs-node?source=c#installation) [and throws an error when it's not.](https://github.com/sgentle/phantomjs-node/blob/eb082f5a799964310b78af642ae3d155f185e6d5/shim.js#L582) This may be a bit off-putting to users running the pa11y command without realizing that PhantomJS is needed (#35). (TBH, I've run into this a few times and it's always taken me a minute to realize what's wrong.)

If there is a check before the sniff is run, a friendlier error message can be shown, something along the lines of 'pa11y requires the `phantomjs` binary to be in your `PATH`'.

It should be enough to check if a file named `phantomjs` exists in one of the many PATH directories.