ubuntu 16.04 に phantomjs 1.9.8 から 2.1.1 バージョンを再インストールできません。助けてください。1.9.8 スピン関数を作成するとエラーが発生します。ドキュメントでは、この問題は再インストールで解決できることを確認してください。
14098 次
6 に答える
33
次の手順で、ubuntu 16.04 に phantomjs 2.1.1 をインストールしました。
sudo apt-get install nodejs
sudo apt-get install nodejs-legacy
sudo apt-get install npm
sudo npm -g install phantomjs-prebuilt
于 2016-04-25T14:34:09.860 に答える
1
私のようにインストールに問題がある人のために
思ったより簡単です...
- phantomjs をアンインストールします: phantomjs を ubuntu から削除するか
sudo apt-get remove phantomjs
、npm フォルダーを削除します。/node_modules/phantomjs
/
ln
/usr/bin
/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はフォルダにインストールします/
/node_module/phantomjs
例
cd /;
npm install phantomjs
- テストビンファイル
例
//check version of phantomjs
/node_modules/phantomjs/bin/phantomjs -v
/node_modules/phantomjs/bin/phantomjs test.js
- リンクファイルビンへ
/usr/bin
:
例
ln -sf /node_modules/phantomjs/bin/phantomjs /usr/bin/phantomjs
- バージョンをチェック
phantomjs -v
して、私の場合は問題ないかどうかを確認してください2.1.1
于 2016-09-13T17:57:52.863 に答える
0
承認された手順がうまくいかなかったので、見つけた解決策を共有しています。
# Install phantomJS
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
# Sanity check
phantomjs --version
>>> 2.1.1
于 2020-01-28T19:16:13.553 に答える