InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

PhantomJS tutorials

  • Install phantomjs on Mac
  • Install phantomjs on Ubuntu
  • create site snapshot thumbnail
  • find all fonts-families on a web page
  • print resources request by a page
  • skip Google analytics when fetching a web page
 
  • Home
  • > Tutorials
  • > Javascript
  • > PhantomJS

How to install phantomjs on Mac

on Feb 26, 2016

Phantomjs on Mac can be installed using Brew or node npm. It can also be downloaded from phantomjs site. We’ll use npm to install phantomjs in this tutorial. Here are the steps to install phantomjs on Mac command line.

  1. First install node and npm on Mac if not already installed.
  2. Get info about phantomjs package

    $ npm info phantomjs
    { name: 'phantomjs',
      description: 'Headless WebKit with JS API',
      'dist-tags': { latest: '2.1.3', alpha: '2.0.0-alpha' },
    ...
    ...
    
  3. Install phantomjs using npm in global mode

    $ npm install -g phantomjs
    $ npm ls -g | grep phantomjs
    └─┬ phantomjs@2.1.3
    
  4. Check if phantomjs is working

    $ phantomjs --version
    2.1.1
    
  5. Check where is phantomjs installed

    $ which phantomjs
    /usr/local/bin/phantomjs
    $ ls -l /usr/local/bin/phantomjs
    lrwxrwxr-x  1 user1  admin  43 Feb 25 23:57 /usr/local/bin/phantomjs -> ../lib/node_modules/phantomjs/bin/phantomjs
    

Suggested posts:

  1. How to install node (node.js) on Mac
  2. How to install phantomjs on Ubuntu Linux
  3. How to install casperjs on Mac
  4. bower – installation and quick start guide
  5. Python filter list/iterable examples
  6. bash – how to use regex in if condition
  7. Mac brew – how to find latest available package without installing
  8. CSS – style for element having two classes (both)
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Mac, Mac Command Line, Node.js, PhantomJS, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress