将PhantomJS 2.1.1安装到Ubuntu14.04中

由于在 ReactJS 下,使用 phantomjs 1.9.7 提取页面并不顺利,所以将其版本升级到 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

只需安装PhantomJS,为什么还要安装npm之类的东西呢?这个评论是最好的,但听说这样做最麻烦的事情最少。

请参考以下内容。