微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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.

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐