NPM将依赖项安装在错误的位置 [英] NPM installs dependencies in a wrong place

查看:296
本文介绍了NPM将依赖项安装在错误的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I just run a simple npm install morgan in a folder and for some reason it adds all the sub dependencies to the parent folder. See image attached

推荐答案

是的,这是npm 3.x中的一项新功能,您可以在此处阅读:

Yes, this is a new feature in npm 3.x, you can read about it here:

https://github.com/npm/npm/releases/tag/v3.0.0

您的依赖项现在将安装为最大程度.在可能的情况下,所有依赖关系及其依赖关系和THEIR依赖关系都将安装在项目的node_modules文件夹中,而不会嵌套.当两个(或更多)模块具有相互依赖的依赖关系时,您只会看到模块彼此嵌套.

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.

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

Basically, it now handles dependencies with as little nesting as possible.

这篇关于NPM将依赖项安装在错误的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆