PhantomJS
Installation
PhantomJS source code can be downloaded from http://phantomjs.org/download.html and then you can compile into your OS.
The other way is to use precompiled binaries. For example on Ubuntu 14.04 follow these instructions:
First we can find package to be installed:
#apt-cache search phantomjs
phantomjs - minimalistic headless WebKit-based with JavaScript API
Then install:
#apt-get install phantomjs
NPM package
The better way I reccomend is to install PhantomJS as NodeJS package. In that case you can use PhantomJS as a NodeJS module.
#npm install -g phantomjs
Now it is inside /usr/lib/node_modules/ directory together with the other NodeJS modules.
npm info postinstall phantomjs@1.9.15
phantomjs@1.9.15 /usr/lib/node_modules/phantomjs
├── which@1.0.8
├── progress@1.1.8
├── kew@0.4.0
├── adm-zip@0.4.4
├── fs-extra@0.16.3 (jsonfile@2.0.0, rimraf@2.2.8, graceful-fs@3.0.5)
├── request-progress@0.3.1 (throttleit@0.0.2)
├── npmconf@2.0.9 (uid-number@0.0.5, inherits@2.0.1, osenv@0.1.0, ini@1.3.2, semver@4.2.0, nopt@3.0.1, once@1.3.1, config-chain@1.1.8, mkdirp@0.5.0)
└── request@2.42.0 (caseless@0.6.0, json-stringify-safe@5.0.0, forever-agent@0.5.2, aws-sign2@0.5.0, stringstream@0.0.4, oauth-sign@0.4.0, tunnel-agent@0.4.0, qs@1.2.2, node-uuid@1.4.2, mime-types@1.0.2, bl@0.9.4, tough-cookie@0.12.1, http-signature@0.10.1, hawk@1.1.1, form-data@0.1.4)