Use the phantom npm module which is maintained and works with the latest version of phantomjs.
Merge pull request #3 from jwark/master

works with the latest version of phantomjs