Thank you for the pointer @admin. That helped me figure this out.

For anyone else having this issue:-
I was using the phantomjs-prebuilt package which wasn't working. When I used 1.9.8 as per the link shared by the @admin it worked :)