From the npm doc, we can get:
If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use.
In this case, it's best to list these additional items in a devDependencies hash.
In a word, packages only used in the development phase should be listed in the devDependencies hash.
relation between dependencies and devDependencies
- In the root of the package,
npm installwill install both devDependencies and dependencies, otherwise it will only install dependencies, such as
npm install --productionor with the
NODE_ENVenvironment variable set to
productionwill only install