Install phantomjs on vagrant

Setup

Make sure you have the right stuff installed

sudo apt-get install nodejs nodejs-dev npm

Check you have nodejs installed by requesting the version

nodejs -v

Check you have npm installed by requesting the version

npm -v

npm errors

I kept getting errors from npm, eg:

Object #<Object> has no method ‘_extend’

I had to update my nodejs. When I checked the version of nodejs I had a 0.6.x version.

I struggled to update nodejs, but found this script online that helped:

sudo apt-get install curl
curl –silent –location https://deb.nodesource.com/setup_4.x | sudo bash –
sudo apt-get install nodejs

Which came from askubuntu.com. http://askubuntu.com/questions/49390/how-do-i-install-the-latest-version-of-node-js

Install phantom js

sudo npm install -g phantomjs