• Skip to main content
  • Skip to primary sidebar

Ryan McCormick

Dedicated Dad, Software Engineer and Lover of Coffee

How to Install PhantomJS 2.5 Beta on MacOS

March 19, 2017 by Ryan McCormick Leave a Comment

PhantomJS on MacOS is a quick, excellent alternative to Google Chrome for a native browser testing platform. The beta version, PhantomJS 2.5 offers support for ES2015 unlike the current stable branch (at the time of writing this article 2.1.x).

Download PhantomJS 2.5 for MacOS

At the time of writing this article, the following versions are available:

  • Ubuntu 16.04 LTS (xenial)
  • Ubuntu 14.04 LTS (trusty)
  • MacOS – unsure if works on El-Capitan or Yosemite. Will find a way to verify in the future.

Download the version for your operating system from:
https://bitbucket.org/ariya/phantomjs/downloads/

Add PhantomJS to Your Path

TL;DR Advanced

You can find the PhantomJS binary under the bin dir of the zip archive. If you have a preferred way of adding items to your path, go ahead and add it. If you don’t have a clue what a path is, then you can follow along below.

  1. After adding to your path, verify by running which phantomjs from the command line.
  2. If everything looks good and you see the correct path, add the PHANTOMJS_BIN variable to your environment by typing export PHANTOMJS_BIN=`which phantomjs`
  3. NOTE: Notice that my example uses the back-tick character and NOT the single quote mark in the example above!

Add PhantomJS to Your Environment

These instructions are based off of the assumption that you downloaded the PhantomJS zip to your downloads directory.

  1. Open your terminal and make sure you are in your home dir.
  2. Type mkdir ./.phantomjs
  3. Move to your new dir cd .phantomjs
  4. Move your archive into your folder cp ~/Downloads/phantomjs-2.5.0-beta-macos.zip ./ (make sure you reference the correct file, as you are typing the filename, you can try hitting the tab key for autocomplete)
  5. Extract your archive unzip ./phantomjs-2.5.0-beta-macos.zip
  6. Rename the extracted dir mv phantomjs-2.5.0-beta-macos phantomjs
  7. Move into the extracted phantom dir cd phantomjs
  8. Move into the phantom bin dir cd bin
  9. Add executable permissions chmod +x phantomjs
  10. Add to your path sudo ln -s `pwd`/phantomjs /usr/local/bin
  11. Test by typing: phantomjs --version (at this point you should see the version. At the time of this post, 2.5.0-development).
    • If the console yells at you with an error about the webp library: /usr/local/lib/libwebp.6.dylib, I posted a solution here: SOLVED: PhantomJS 2.5 Beta: Library not loaded: libwebp.6.dylib
    • If you don’t get a version, you may need to add execute permissions. Browse back to your extracted phantom bin dir and type chmod +x phantomjs. Try checking your PhantomJS version again. If you still don’t see version information, type source ~/.bash_profile and type which phantomjs (you should see a path to the phantomjs bin folder)
  12. After you have verified that you are showing phantomjs 2.5+, you need to add the PHANTOMJS_BIN variable to override other global installations. type: echo "export PHANTOMJS_BIN=`which phantomjs`" >> ~/.bash_profile
  13. Close and re-open your terminal or type: source ~/.bash_profile
  14. Verify PHANTOMJS_BIN var: echo $PHANTOMJS_BIN (you should see the executable path for your phantomjs 2.5).

Related

Filed Under: MacOS Tagged With: install phantomjs 2.5 beta on macos, phantom typescript, phantomjs

Reader Interactions

Leave a Reply Cancel reply

Primary Sidebar

Recent Posts

  • Force Quit Kill all Chrome Windows MacOS
  • SOLVED: Angular 6 CLI Karma Stuck in Single Run | Karma Stops Running
  • How to Manually Install Java 8 on Ubuntu 18.04 LTS
  • Remove VirtualBox from Ubuntu 16.04 Xenial
  • Clear all Node Modules Folders Recursively Mac/Linux

Recent Comments

  • KKV on Webstorm adding spaces between imports and braces | JavaScript and TypeScript
  • jusopi on Clear all Node Modules Folders Recursively Mac/Linux
  • Qaisar Irfan on Clear all Node Modules Folders Recursively Mac/Linux
  • mustafa on Remove VirtualBox from Ubuntu 16.04 Xenial
  • Pourya on How to Manually Install Java 8 on Ubuntu 18.04 LTS

Archives

  • May 2019
  • May 2018
  • April 2018
  • March 2018
  • January 2018
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • March 2017
  • December 2015
  • November 2015
  • July 2015
  • April 2015
  • February 2015
  • September 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • October 2013
  • August 2013
  • June 2013
  • April 2013
  • March 2013
  • February 2013
  • December 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • May 2012
  • March 2012
  • February 2012
  • December 2011
  • November 2011
  • April 2011
  • March 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • August 2009
  • July 2009
  • May 2009

Categories

  • Angular
  • Angular 2
  • AngularJS (1x branch)
  • Computer Q&A
  • ES2015
  • Internet Marketing
  • Javascript
  • Job Interviews
  • Job Search
  • Karma
  • Laravel
  • Linux
  • Linux/Unix Tips
  • MacOS
  • Microsoft Access
  • Microsoft Excel
  • Microsoft Outlook
  • Microsoft Word
  • News
  • Node
  • Open Source
  • PHP
  • Protractor
  • Resume Writing
  • Spring Boot
  • SQL
  • Ubuntu
  • VBA
  • VBScript
  • VirtualBox
  • Web Development
  • Windows Tips
  • Wordpress

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 2023 · Magazine Pro on Genesis Framework · WordPress · Log in