ubuntu升级nodejs.安装PHANTOMJS, CASPERJS

Get nodeJS from personal Repository to get the latest version.

1
2
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update

 
Install NPM, NodeJS:

1
sudo apt-get install nodejs

 
Now, check with command:

1
2
npm -v
node -v

 
You can install CasperJS via NPM command:

1
sudo npm install -g casperjs

 
Install PhantomJS (Download source, extract files, create soft-link to executable directory):

1
2
3
4
5
6
cd /usr/local/share
sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
sudo tar xjf phantomjs-1.9.8-linux-x86_64.tar.bz2
sudo ln -s /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.8-linux-x86_64/bin/phantomjs /usr/bin/phantomjs

 
Check your installation with command:

1
phantomjs -v

 

 

升级nodejs

1
2
3
4
5
6
7
8
1,
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -

apt-get install nodejs

2,或者下载https://deb.nodesource.com/node_5.x/pool/main/n/nodejs/nodejs_5.3.0-1nodesource1~trusty1_amd64.deb

dpkg -i nodejs_5.3.0-1nodesource1-trusty1_amd64.deb

 

坚持原创技术分享,您的支持将鼓励我继续创作!