I was trying to install phantomjs in order to make test Twitter Bootstrap. After I had installed it locally i.e. npm install phantomjs, it
phantomjs should be included in your local .json package(manually editing it or using --save command see TheHippo's answer). If it is installed somewhere and you don't need it use the prune command
npm prune
will remove all non-required packages.
To install an item both locally and globally use:
sudo npm install -g phantomjs
npm install wont install phantom.js again.) (Btw.: npm install xxx --save will automatically add xxx to the package.json)