How to install phantomjs & casperjs

To install phantomjs & casperjs, do not use your distribution packages, you won’t have the right versions and your casperjs version will not be compatible with phantomjs version.

Instead, follow theses simple steps :

cd /opt
tar xjvf phantomjs-1.9.7-linux-x86_64.tar.bz2
ln -s ln -s phantomjs-1.9.7-linux-x86_64 phantomjs
ln -s /opt/phantomjs/bin/phantomjs /usr/local/bin

cd /opt
unzip 1.1-beta3
ln -s n1k0-casperjs-4f105a9/ casperjs
ln -s /opt/casperjs/bin/casperjs /usr/local/bin/

To test it, simply run the casperjs command

root@bigone:/opt# casperjs
CasperJS version 1.1.0-beta3 at /opt/casperjs, using phantomjs version 1.9.7
Usage: casperjs [options] script.1 [script argument [script argument ...]]
      casperjs [options] test [test path [test path ...]]
      casperjs [options] selftest
      casperjs [options] __selfcommandtest


--verbose   Prints log messages to the console
--log-level Sets logging level
--help      Prints this help
--version   Prints out CasperJS version
--engine=name Use the given engine. Current supported engine: phantomjs and slimerjs

Read the docs

Leave a Reply