Package.json and Dependencies
dependencies vs devDependencies
Dependencies
Dependencies that your project needs to run, like a library that provides functions that you call from your code.
dependencies are installed on both:
- a directory that contains package.json
- npm i $packageon any other directory
devDependencies
Dependencies you only need during development or releasing, like compilers that take your code and compile it into javascript, test frameworks or documentation generators.
devDependencies are installed on:
- a directory that contains package.json(unless given--productionflag)- or if NODE_ENV=productionenvironment variable is set
 
- or if 
- NOT installed on npm install $packageon any other directory
- are not installed transitively
From end user perspective, you normally don't want the development dependencies, so you just get what is needed to use the package (dependencies, not devDependencies).
If you want to develop, you would need additional packages needed for dependencies like tests.
What is transitive
dependencies are installed transitively
- if ArequiresB, andBrequiresC, thenCgets installed, otherwiseBcould not work, and neither wouldA.
devDependencies are not installed transitively.
- we don't need to test Bto testA, soB's testing dependencies can be left out.