首页 > 安装phantomjs后输入phantomjs --v提示:-bash:phantomjs:command not found

安装phantomjs后输入phantomjs --v提示:-bash:phantomjs:command not found

centos,按照网上的教程:

sudo yum install gcc gcc-c++ make git openssl-devel freetype-devel fontconfig-devel 
git clone git://github.com/ariya/phantomjs.git 
cd phantomjs 
git checkout 1.9 
./build.sh  

安装了一个多小时完成后输入phantomjs --v,显示-bash:phantomjs:command not found,请问该怎么办?


ln -s /usr/local/src/phantomjs/bin/phantomjs /usr/local/bin/
/usr/local/src/phantomjs/bin/phantomjs为你的安装路径


估计是phantomjs没有把其可执行路径加入到PATH中。

# vim /etc/profile

在最后,添加:

export PATH="$PATH:/yourpath"

将 root/phantomjs/bin/phantomjs 复制到系统/bin 就可以了


遇到了同样的问题 请问怎么解决的呢?


试试一楼的方法Ok不,不行的话,加上下面这句话,我似乎之前也遇到过

export PHANTOMJS_EXECUTABLE=/usr/local/bin/phantomjs

/usr/local/bin/phantomjs换成你自己安装之后的二进制文件路径。

【热门文章】
【热门文章】