如何在ubuntu上更新phantomjs 1.9.8到phantomjs 2.1.1?

如何在ubuntu上更新phantomjs 1.9.8到phantomjs 2.1.1?,第1张

概述如何在ubuntu上更新phantomjs 1.9.8到phantomjs 2.1.1?

我不能重新安装phantomJs 1.9.8到2.1.1版本在我的Ubuntu 16.04请帮助。 1.9.8给我一个错误,当我写一个旋转函数,在文档中看到这个问题,我可以用reinstlation解决。

如何在某些“if”语句中使用windows版本标题以确定要检查哪些windows更新?

慢WUA(windows更新API)

更新Python 2.7.7到2.7.9 – 是否安全?

更新不适用于windows10

崇高的文字2便携式更新不知道如何?

我刚刚在ubuntu 16.04中安装了phantomJs 2.1.1,下面是一些Google搜索后发现的步骤:

sudo apt-get install nodeJs sudo apt-get install nodeJs-legacy sudo apt-get install npm sudo npm -g install phantomJs-prebuilt

如果我正在开发,我将如何做到这一点。 该软件包版本为nodeJs而不是ubuntu:

使用nvm : https : //github.com/creationix/nvm

touch ~/.profile curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.7/install.sh | bash source ~/.profile # node 6x nvm install 6.5.0 npm install [email protected] # node 4x nvm install 4.5.0 nvm use 4.5.0 npm install [email protected] # node 0.12x nvm install 0.12 npm show phantomJs@* version npm install [email protected]

也许我们正在开发0.10,0.12,4.X,ioJs4.x,6.X,etc现在我们可以选择任何一个版本的phantomJs:

jmunsch@ubuntu:~$ npm show phantomJs@* version [email protected] '0.0.1' [email protected] '0.0.2' [email protected] '0.0.3' [email protected] '0.0.4' [email protected] '0.0.5' [email protected] '0.0.6' [email protected] '0.0.7' [email protected] '0.0.8' [email protected] '0.0.9' [email protected] '0.1.0' [email protected] '0.1.1' [email protected] '0.2.0' [email protected] '0.2.1' [email protected] '0.2.2' [email protected] '0.2.3' [email protected] '0.2.4' [email protected] '0.2.5' [email protected] '0.2.6' [email protected] '1.9.8' [email protected] '1.9.9' [email protected] '1.9.10' [email protected] '1.9.11' [email protected] '1.9.12' [email protected] '1.9.13' [email protected] '1.9.15' [email protected] '1.9.16' [email protected] '1.9.17' [email protected] '1.9.18' [email protected] '1.9.19' [email protected] '2.1.1' [email protected] '2.1.2' [email protected] '2.1.3' [email protected] '1.9.20' [email protected] '2.1.7'

系统范围的部署场景等

这里是如何使用tarball

export PHANTOM_Js_VERSION=2.1.1 wget "https://bitbucket.org/ariya/phantomJs/downloads/phantomJs-$PHANTOM_Js_VERSION-linux-x86_64.tar.bz2" tar xvfj "./phantomJs-$PHANTOM_Js_VERSION-linux-x86_64.tar.bz2" ln -sf "./phantomJs-$PHANTOM_Js_VERSION-linux-x86_64/bin/phantomJs" "/usr/bin"

测试在Ubuntu 14.04,也许移动文件夹到另一个地方以外./

更新16.04:

wget可能会也可能不会工作请参阅: https : //github.com/Medium/phantomJs/issues/161

# install dependencIEs sudo apt-get install libFontconfig # extract the tar file tar xvfj "./phantomJs-$PHANTOM_Js_VERSION-linux-x86_64.tar.bz2" # use full path ln -sf "$(pwd)/phantomJs-$PHANTOM_Js_VERSION-linux-x86_64/bin/phantomJs" "/usr/bin"

错误

phantomJs:加载共享库时出错:libFontconfig.so.1:无法打开共享目标文件:没有这样的文件或目录

尝试:

sudo apt-get install libFontconfig

所以,jmunsch的答案适用于我,但只是为了提供一个清晰而简单的配方:

export PHANTOM_Js_VERSION=2.1.1 sudo apt-get install libFontconfig wget "https://bitbucket.org/ariya/phantomJs/downloads/phantomJs-$PHANTOM_Js_VERSION-linux-x86_64.tar.bz2" tar xvfj "./phantomJs-$PHANTOM_Js_VERSION-linux-x86_64.tar.bz2" ln -sf "$(pwd)/phantomJs-$PHANTOM_Js_VERSION-linux-x86_64/bin/phantomJs" "/usr/bin"

最后一行需要sudo,因为/ usr / bin,但是你可以把符号链接放在任何地方…

对于那些有问题要像我一样安装

它比你想象的更容易…

我卸载phantomJs:从ubuntu删除phantomJs sudo apt-get remove phantomJs或删除/node_modules/phantomJs npm文件夹它将在/ ,也许你需要删除在/usr/bin或/usr/local/bin/ phantomJs的链接/usr/local/bin/它的名字是phantomJs

//use this if you installed with apt-get sudo apt-get remove phantomJs *remove the phantomJs rm /usr/bin/phantomJs *use this if the link dIDn't remove. //use this if you installed from npm: like this: npm install phantomJs rm -R /node_modules/phantomJs *note: it will be in other folder,search it.

从npm安装phantomJs: npm install phantomJs从/目录npm install phantomJs ,npm将其安装在文件夹/node_module/phantomJs

cd /; npm install phantomJs

测试bin文件

//check version of phantomJs /node_modules/phantomJs/bin/phantomJs -v /node_modules/phantomJs/bin/phantomJs test.Js

将文件bin链接到/usr/bin :

ln -sf /node_modules/phantomJs/bin/phantomJs /usr/bin/phantomJs

检查它的版本,看看是否可以


phantomJs -v在我的情况2.1.1

phantomJs 2.1.1现在已经与16.04( https://launchpad.net/ubuntu/xenial/+source/phantomJs )捆绑在一起,所以你应该能够安装/升级它作为一个系统包。

更新:此答案存在信息的目的,但不建议使用系统包版本现在由于这样的问题: https : //BUGs.launchpad.net/ubuntu/+source/phantomJs/+BUG/1605628这是与上游文件上传问题有关,但修复的性质阻止了它作为系统软件包工作。

目前最好的选择是使用预编译的二进制文件: https : //bitbucket.org/ariya/phantomJs/download

总结

以上是内存溢出为你收集整理的如何在ubuntu上更新phantomjs 1.9.8到phantomjs 2.1.1?全部内容,希望文章能够帮你解决如何在ubuntu上更新phantomjs 1.9.8到phantomjs 2.1.1?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1155142.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存