Ben phantomjs 1.9.8 16.04 yardım edin benim ubuntu üzerinde sürüm 2.1.1 için yeniden olamaz. 1.9.8 Bir döndürme fonksiyonu yazdığımda bana bir hata verin, belgelere bakınca bu yeniden yapılanma ile çözebileceğime bakın.Nasıl ubuntu phantomjs 1.9.8 phantomjs 2.1.1 güncellenir?
cevap
Sadece googling biraz sonra bulundu aşağıdaki adımlarla birlikte ubuntu 16.04 yılında phantomjs 2.1.1 yüklü:
İştesudo apt-get install nodejs
sudo apt-get install nodejs-legacy
sudo apt-get install npm
sudo npm -g install phantomjs-prebuilt
Ben gelişmekte olsaydı ben bunu yapacağını nasıl. paketler nodejs için sürüm bilgisi ve edilir değil ubuntu:
Kullanım nvm
:
[email protected]:~$ npm show [email protected]* 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'
: 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 [email protected]* version
npm install [email protected]
Belki de şimdi phantomjs hangisi sürümünü seçmek erişimi de 0.10, 0.12, 4.X, iojs4.x, 6.X, etc
üzerine gelişiyor sistem genelinde dağıtım senaryoları için, vb İşte
nasıl tarball'ıkullanıyor
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"
belki 16.04 için
./
güncelleştirmesi dışında başka bir yere klasörü taşınırken, ubuntu 14.04 üzerinde test: veya çalışmıyor olabilir
wget bkz: 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"
Hata
phantomjs: yükleme hatası paylaşılan kütüphaneleri ise: libfontconfig.so.1: paylaşılan nesne dosyası açılamıyor: Böyle bir dosya ya da dizin
Dene: Benim gibi yüklemek için problem olanlar için
sudo apt-get install libfontconfig
İlgilendiğiniz doğru bir bağımlılık sorunu benziyordu güncellenmiş ve göreli yol bağlantı sorunu olabilir 3zzy @ Ubuntu 16.04 – 3zzy
üzerinde çalışmaz. Her ne sebeple olursa olsun "wget" işe yaramadı, bu yüzden makineye katran topu aldım. Aynı 403 acess reddedildi hatasıyla github sorunu eklendi. – jmunsch
sandığından daha kolay ...
- Ben phantomjs kaldırın: ubuntu
sudo apt-get remove phantomjs
gelen phantomjs kaldırın ya da/
olacaktır/node_modules/phantomjs
ait npm klasörü kaldırmak, belki de gidip adınıphantomjs
olduğu
/usr/bin
veya
/usr/local/bin/
içinde
ln
phantomjs bağlantısını kaldırmak gerekir
Örnek
//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 gelen phantomjs yükleyin: npm,
/
dizindennpm install phantomjs
klasöre yüklemek/node_module/phantomjs
Örnek
cd /;
npm install phantomjs
- Testi bin dosyası
Örnek
//check version of phantomjs
/node_modules/phantomjs/bin/phantomjs -v
/node_modules/phantomjs/bin/phantomjs test.js
- bağlantı dosyası bin
/usr/bin
için: tamam eğer bunun
Örnek
ln -sf /node_modules/phantomjs/bin/phantomjs /usr/bin/phantomjs
- onay versiyonu görmek için benim durumumda
phantomjs -v
2.1.1
Yani, jmunsch cevabı benim için çalışıyor, ama sadece net ve minimal tarifi sağlamak için:
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"
Son satır çünkü/usr/bin sudo gerektirir, ancak her yerde sembolik koyabilirsiniz ...
phantomjs 2.1.1 şu anda 16.04 (https://launchpad.net/ubuntu/xenial/+source/phantomjs) ile birlikte paketlenmiştir, böylece bir sistem paketi olarak yükleme/yükseltme yapabilmeniz gerekir.
Güncelleme: Bu cevap bilgilendirme amaçlı mevcut fakat uğraması gibi sorunlar artık sistem paketi sürümünü kullanmak tavsiye değildir: https://bugs.launchpad.net/ubuntu/+source/phantomjs/+bug/1605628 Bu akıntıya karşı giderilmiştir dosya yükleme ile ilgili bir sorun ile ilgilidir, ancak düzeltmenin doğası bir sistem paketi olarak çalışmasını engelledi.
iyi anki seçenek arasından önceden oluşturulmuş ikili kullanmaktır: PhantomJS node.js veya NPM (yalnızca kolaylık yüklü) ile ilgisi yoktur yana https://bitbucket.org/ariya/phantomjs/download
bu ilgisi olmayan bir tek ikili için bütün ekosistem yükler Ekosistem ile ilgili. –
Yeterince doğru. Nodejs (ve nodejs-legacy) npm tarafından phantomjs'i başarılı bir şekilde kurmak için gereklidir. Takip ettiğim adımlar pythonda selenyum ile kullanmaktı. Npm, bir kez bittiğinde her zaman kaldırılabilir.Bu, PhantomJS sürücüsünün selenyum ile çalışmasını sağlamak için çok hızlı bir yoldu. – dmdip