Extraneous Package when Installed Locally Extraneous Package when Installed Locally node.js node.js

Extraneous Package when Installed Locally


  1. Yes. (Re-installing with npm install wont install phantom.js again.) (Btw.: npm install xxx --save will automatically add xxx to the package.json)
  2. Yes. Local package versions are preferred over global ones. (Although you need some path handling for executables.)


  1. 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.

  1. To install an item both locally and globally use:

    sudo npm install -g phantomjs