27

I can't install phantomJs in my macbook after upgrading to 10.11 (El Capitan).

Whenever I try to install it using homebrew it gives me this error:

$ brew install phantomjs
phantomjs: OS X Yosemite or older is required.
Error: An unsatisfied requirement failed this build.
jfcorugedo
  • 9,793
  • 8
  • 39
  • 47

7 Answers7

42

Something is broken since Xcode 7, if you have npm you can install it:

npm install -g phantomjs-prebuilt

Now that the issue have been handled, you can download it.

Thomas Ayoub
  • 29,063
  • 15
  • 95
  • 142
19

Note that :

npm install -g phantomjs 

Will install v1.9.8

The latest preview version v2.0.1 works correctly on 10.11 El Captian is available as a binary download.

Just copy bin/phantomjs from the download into /usr/local/bin/ (or wherever you want it) on your machine.

dwkns
  • 2,369
  • 4
  • 22
  • 35
13
brew update

then

brew install phantomjs
Hossam Mourad
  • 4,369
  • 4
  • 26
  • 22
  • For me neither the brew nor downloaded from phantomjs.org 2.1 version is not working. I've been struggling all evening. After downgrading to 2.0 (downloaded from https://github.com/eugene1g/phantomjs/releases) everything is working. I'm using codeception with acceptance test on Mac Os Sierra. – Rafał Mnich Dec 13 '16 at 21:17
6

Install It through Homebrew or MacPorts

brew install phantomjs

or

port install phantomjs

Check the version using: phantomjs --version

Which will install the latest version. Currently: 2.1.1

My Mac OSX version: OS X El Capitan - Version 10.11.6

Thanks!

Subhajit
  • 390
  • 3
  • 18
4

If that doesn't work try:

brew install npm

npm install phantom phantomjs -g
Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
Gcamara14
  • 510
  • 4
  • 14
4

The quickest and easiest way to install stand-alone phantomjs (tested on Mac OSX El Captian) (using brew or macports to install takes too long time since they will install the whole qt and other packages)

  • download and unzip phantomjs-2.0.0-macosx.zip from http://phantomjs.org/download.html

  • brew install upx

  • upx -d phantomjs-2.0.0-macosx/bin/phantomjs

  • Add phantomjs to system path in Terminal: sudo nano /etc/paths

  • echo $PATH
  • add your_directory/phantomjs-2.0.0-macosx/bin to the end
  • Hit control-x to quit.
  • Enter “Y” to save the modified buffer.
  • restart terminal
  • Terminal: phantomjs -v will show you the version of phantomjs if it is correctly installed
Community
  • 1
  • 1
Shi Jieming
  • 541
  • 6
  • 5
4

Latest released binary (2.1.1) for Mac has all the dependencies included in the binary. It works out of the box http://phantomjs.org/download.html

Pandurang Patil
  • 966
  • 7
  • 11