我只是在一个文件夹中运行一个简单的npm install morgan,由于某种原因它将所有子依赖项添加到父文件夹.见附图 是的,这是npm 3.x中的一个新功能,你可以在这里阅读: https://github.com/npm/npm
https://github.com/npm/npm/releases/tag/v3.0.0
Your dependencies will now be installed maximally flat. Insofar as is possible, all of your dependencies, and their dependencies, and THEIR dependencies will be installed in your project’s
node_modules
folder with no nesting. You’ll only see modules nested underneath one another when two (or more) modules have conflicting dependencies.
基本上,它现在使用尽可能少的嵌套来处理依赖项.