Exclude npm module dependency?

In a project I am working on, we are using Karma test drive and karma-phantomjs-launcher to help us run tests with PhantomJS.We recently discovered that the version of PhantomJS that is dumped as a dependency on karma-phantomjs-launcher 1.9.8

has some issues causing our tests to fail. Luckily, karma-phantomjs-launcher allows us to set an environment variable PHANTOMJS_BIN

to point to an alternate PhantomJS binary instead, which would make it easier to upgrade to 2.0.0

.

This is all fine and dandy, but when our CI tries to build our project, it still compresses the PhantomJS binary 1.9.8

at runtime npm install

, as it needs to be installed karma-phantomjs-launcher

which depends on PhantomJS 1.9.8

.

Since our build server is configured to use the binary 2.0.0

we provided it, there really is no need to download the binary 1.9.8

, and I would prefer it not if possible.

So, is there a way I could tweak my package.json to tell karma-phantomjs-launcher

it it doesn't need to disable the PhantomJS dependency 1.9.8

?

+3


source to share


1 answer


Use a module without dependency:

Downloading phantomjs the PhantomJS package from a third party website. While this loading can be prevented by making sure you have the correct version of PhantomJS in your PATH, it is not always convenient.

This package removes phantomjs from dependencies and requires you to explicitly set the path to PhantomJS.

Or remove it from the default package.json package. For example in Linux shell:

cd node_modules/karma-phantomjs-launcher
vi package.json

      



Remove the ad dependencies

:

  "dependencies": {
    "phantomjs": "~1.9"
    },

      

Links

0


source







All Articles