Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force nested npm dependency in package.json [duplicate]

I believe this is pretty common question, but still I could not find reliable answer.

In my package.json I have dependency - "grunt-selenium-webdriver", which has some dependency version listed in its package.json which is not accessible from our network (we are using internal NPM registry which lags sometimes).

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

PS: I tried peer dependencies, but it seems that it aims to solve another issue.

like image 683
vgrinko Avatar asked Sep 09 '14 12:09

vgrinko


People also ask

How do I force npm to install dependencies?

NPM installs devDependencies within the package. json file. The 'npm install' command should add all the dependencies and devDependencies automatically during installation. If you need to add specific devDependencies to your project, you can use this command- 'npm install --save-dev'.

What happens if you npm init twice?

When you run npm init twice then it's update the package. json file as per your new init data you enter in last npm init call. Save this answer.


1 Answers

You can achieve this by NPM-Shrinkwrap functionality.

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

like image 144
Ravi Avatar answered Sep 27 '22 23:09

Ravi