How to force npm nested dependency in package.json

I think this is a fairly common question, but still I could not find a reliable answer.

In my .json package, I have a dependency - "grunt-selenium-webdriver", which has some version of the dependencies specified in its package. json, which is not available from our network (we use the internal NPM registry, which sometimes interferes).

I want to use the current version of grunt-selenium-webdriver, but with a different version of the nested dependency. Is this possible?

PS: I tried peer dependencies, but it looks like it is trying to solve another problem.

+6
source share
1 answer

You can achieve this with NPM-Shrinkwrap .

Other examples can be found at managing-node-js-dependencies-with-shrinkwrap .

+6
source

Source: https://habr.com/ru/post/975031/


All Articles