Summary of important behavior differences:
dependenciesare installed on both:
npm installfrom a directory that contains
npm install $packageon any other directory
npm installon a directory that contains
package.json, unless you pass the
npm install $packageon any other directory, unless you give it the
npm install, and you have to solve the dependency yourself manually. When running, if the dependency is missing, you get an error.
dependenciesare installed transitively: if A requires B, and B requires C, then C gets installed, otherwise B could not work, and neither would A.
devDependenciesare not installed transitively. E.g. we don't need to test B to test A, so B's testing dependencies can be left out.