Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update phantomjs 1.9.8 to phantomjs 2.1.1 on ubuntu?

I cant reinstall phantomjs 1.9.8 to 2.1.1 version on my ubuntu 16.04 Please help. 1.9.8 give me an errors when I write a spin functions, in documentation see that this ploblem I can solve with reinstalation.

like image 658
Andrzej Moroz Avatar asked Apr 25 '16 11:04

Andrzej Moroz


People also ask

How to remove PhantomJS ubuntu?

//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.


2 Answers

I just installed phantomjs 2.1.1 in ubuntu 16.04 with the following steps, which I found after a bit of googling :

sudo apt-get install nodejs
sudo apt-get install nodejs-legacy
sudo apt-get install npm
sudo npm -g install phantomjs-prebuilt
like image 156
dmdip Avatar answered Sep 16 '22 16:09

dmdip


So, jmunsch's answer works for me, but just to provide a clear and minimal recipe:

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"

The last line requires sudo because of /usr/bin, but you can put the symlink anywhere...

like image 41
Fredrik Bränström Avatar answered Sep 19 '22 16:09

Fredrik Bränström