PhantomJS: getting "Killed: 9" for anything I'm trying

PhantomjsOsx Yosemite

Phantomjs Problem Overview


Just installed phantomjs, mac os x yosemite. Whenever I run /bin/phantomjs, with any parameter, I get Killed: 9. Any idea?

Phantomjs Solutions


Solution 1 - Phantomjs

  1. Install UPX. UPX is an executable packer and unpacker

     $ brew install upx
    
  2. Unpack the phantomjs executable

     $ upx -d phantomjs-2.0.0-macosx/bin/phantomjs
    
  3. Run the phantomjs executable

     $ ./phantomjs-2.0.0-macosx/bin/phantomjs
    

Solution 2 - Phantomjs

re: running phantomjs on osx yosemite, download the build/fix found at:

https://github.com/eugene1g/phantomjs/releases

original issue:

https://github.com/ariya/phantomjs/issues/12928

Solution 3 - Phantomjs

The eugene1g release and UPX install didn't work for me on El Capitan. What did work for me was installing PhantomJS using the phantomjs2 NPM package:

npm install phantomjs2

# Optional: symlink in a dir that's on my PATH:
ln -s /usr/local/lib/node_modules/phantomjs2/lib/phantom/bin/phantomjs /usr/local/bin/phantomjs 

Solution 4 - Phantomjs

$ npm install -g phantomjs worked for me on El Capitan.

The npm package isn't "official", it's maintained by a contributor, but it works. https://github.com/eugene1g/phantomjs

Solution 5 - Phantomjs

Blunt re-install using brew

Whatever is in /usr/local/bin/phantomjs has stopped working for you.

If you've got ~30mins to spare you can reinstall and relink using brew:

  # unlink old version
  brew unlink phantomjs

  # reinstall phantomjs
  brew update && brew install phantomjs

  # (You may wish to make a refreshing herbal tea or similar beverage here...)

  # Update link to usr/local/bin
  brew link --overwrite phantomjs

If you want to test what brew will do with overwrite you can run

 brew link --overwrite --dry-run phantomjs 

Solution 6 - Phantomjs

Sometimes this happens when your current shell process is killed.

I was in tmux using brew update, and brew updated tmux and bash, then bang! Everything in tmux just returns Killed: 9.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionazvView Question on Stackoverflow
Solution 1 - PhantomjsRamView Answer on Stackoverflow
Solution 2 - PhantomjssdeburcaView Answer on Stackoverflow
Solution 3 - PhantomjsBlaiseView Answer on Stackoverflow
Solution 4 - PhantomjsAditya M PView Answer on Stackoverflow
Solution 5 - PhantomjsRalph CowlingView Answer on Stackoverflow
Solution 6 - Phantomjsdz902View Answer on Stackoverflow