Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install npm devdependencies recursively?

I am working on a project which gives cli options to another project. The cli requires some extra dependency which I had listed as devdependency. However, when installed on the target project, the devdependency are not being installed.

npm install : Installs first level of dev dependency but the dev dependency of a dependency is not installed.

There used to be an option but it was actually a bug and therefore removed. Is there a way to do this now?

like image 945
cnvzmxcvmcx Avatar asked Aug 22 '16 12:08

cnvzmxcvmcx


People also ask

How do you install devDependencies?

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

Does npm install Peerdependencies?

When running npm install , it does not install the peer dependencies automatically even if they are in the package-lock. json file. Instead it modifies the package-lock. json file removing all the peer dependencies.

What is devDependencies in package json?

Dev Dependencies: In package. json file, there is an object called as dev Dependencies and it consists of all the packages that are used in the project in its development phase and not in the production or testing environment with its version number.

What is difference between Dev dependencies and devDependencies?

The difference between these two, is that devDependencies are modules which are only required during development, while dependencies are modules which are also required at runtime. To save a dependency as a devDependency on installation we need to do an npm install --save-dev , instead of just an npm install --save.


1 Answers

If the dependency is required by the target project that is installing it, it should be listed as a dependency. DevDependencies are intended for use only when the module itself is being developed (eg test and packaging tools. )

like image 144
Paul Avatar answered Sep 23 '22 18:09

Paul