码迷,mamicode.com
首页 > Web开发 > 详细

Ubuntu下phantomjs的安装

时间:2019-05-16 11:10:32      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:load   usr   不可用   使用   环境变量   ant   npm   tom   stat   

1、安装

ubuntu下面可以直接使用命令安装(不可用)

sudo apt-get install phantomjs

 官方下载:

# 官方网站:
http://phantomjs.org/download.html 
# 淘宝镜像:
https://npm.taobao.org/mirrors/phantomjs 

 

 2、解压

tar -xvf phantomjs-1.9.7-linux-i686.tar.bz2

 

# 注:解压失败,出现一下错误时,先查看压缩包是什么类型 file phantomjs-1.9.7-linux-i686.tar.bz2 看是否是bzip2类型再解压
# bzip2: (stdin) is not a bzip2 file.
# tar: Child returned status 2
# tar: Error is not recoverable: exiting now

 

 

3、创建软链接到环境变量中。这样可以直接在shell中使用phantomjs命令:

sudo ln -sf /usr/local/src/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
# 其中的参数s表示为软链接,参数f表示强制。
#(或)添加到系统常量:
cp phantomjs /usr/local/bin

 

4、查看是否安装成功:

 

phantomjs –v

 

出现版本号则为成功安装

 

 

 

Ubuntu下phantomjs的安装

标签:load   usr   不可用   使用   环境变量   ant   npm   tom   stat   

原文地址:https://www.cnblogs.com/yekushi-Z/p/10874135.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!