PhantomJS:为我正在尝试的任何事情获得 "Killed: 9"

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

刚刚安装了 phantomjs,mac os x yosemite。每当我使用任何参数 运行 /bin/phantomjs 时,我都会得到 Killed: 9。有什么想法吗?

回复:运行 osx yosemite 上的 phantomjs,下载位于 build/fix 的 build/fix:

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

原刊:

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

  1. 安装 UPX。 UPX 是一个可执行的打包器和解包器

    $ brew install upx
    
  2. 解压缩 phantomjs 可执行文件

    $ upx -d phantomjs-2.0.0-macosx/bin/phantomjs
    
  3. 运行 phantomjs 可执行文件

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

eugene1g 版本和 UPX 安装对我在 El Capitan 上不起作用。对我有用的是使用 phantomjs2 NPM 包安装 PhantomJS:

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 

使用 brew 重新安装

/usr/local/bin/phantomjs 中的任何内容都已停止为您工作。

如果您有大约 30 分钟的空闲时间,您可以使用 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

如果你想测试 brew 会用 overwrite 做什么,你可以 运行

 brew link --overwrite --dry-run phantomjs 

$ npm install -g phantomjs 在 El Capitan 为我工作。

npm 包不是 "official",它由贡献者维护,但它可以工作。 https://github.com/eugene1g/phantomjs

有时当您当前的 shell 进程被终止时会发生这种情况。

我在 tmux 使用 brew updatebrew 更新了 tmuxbash,然后砰! tmux 中的所有内容只是 returns Killed: 9.