Extraneous Package when Installed Locally

前端 未结 2 1457
猫巷女王i
猫巷女王i 2020-12-24 00:23

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

相关标签:
2条回答
  • 2020-12-24 00:50
    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

    0 讨论(0)
    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.)
    0 讨论(0)
提交回复
热议问题