CasperJS on Mac can be installed using Brew or node npm. We’ll use npm to install casperjs in this tutorial. Here are the steps to install casperjs on Mac command line.
- First install node and npm on Mac if not already installed.
-
Get info about casperjs package
$ npm info casperjs { name: 'casperjs', description: 'A navigation scripting & testing utility for PhantomJS and SlimerJS', 'dist-tags': { latest: '1.1.0-beta5' }, versions: [ '1.1.0-beta2', '1.1.0-beta3', '1.1.0-beta4', '1.1.0-beta5' ], maintainers: [ 'istr
', 'n1k0 ' ], ... ... -
Install casperjs using npm in global mode
$ npm install -g casperjs $ npm ls -g | grep casperjs ├── casperjs@1.1.0-beta5
-
Check if casperjs is working
$ casperjs --version 1.1.0-beta5
-
Check where is casperjs installed
$ which casperjs /usr/local/bin/casperjs $ ls -l /usr/local/bin/casperjs lrwxrwxr-x 1 user1 admin 41 Feb 26 00:18 /usr/local/bin/casperjs -> ../lib/node_modules/casperjs/bin/casperjs