mac下配置phantomjs

来源:互联网 发布:js 数组排序 按大小 编辑:程序博客网 时间:2024/05/16 10:32

配置.bash_profile文件后一定要source

安装步骤

  1. 下载phantomjs,官网下载mac版本即可 http://phantomjs.org/download.html
  2. 下载后将phantomjs-2.1.1-macosx文件夹放到/Users/xxx目录下
  3. 终端输入vim .bash_profile
  4. 添加语句(i插入,esc退出,:wq保存关闭)
export PATH="/Users/xxx/phantomjs-2.1.1-macosx/bin:$PATH" 

5. 终端输入source .bash_profile

测试

localhost:~ xxx$ phantomjs --version2.1.1