node.js – NPM在错误的地方安装依赖项

我只是在一个文件夹中运行一个简单的npm install morgan,由于某种原因它将所有子依赖项添加到父文件夹.见附图

enter image description here

解决方法

是的,这是npm 3.x中的一个功能,你可以在这里阅读:

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.

基本上,它现在使用尽可能少的嵌套来处理依赖项.

相关文章

这篇文章主要介绍“基于nodejs的ssh2怎么实现自动化部署”的...
本文小编为大家详细介绍“nodejs怎么实现目录不存在自动创建...
这篇“如何把nodejs数据传到前端”文章的知识点大部分人都不...
本文小编为大家详细介绍“nodejs如何实现定时删除文件”,内...
这篇文章主要讲解了“nodejs安装模块卡住不动怎么解决”,文...
今天小编给大家分享一下如何检测nodejs有没有安装成功的相关...