为什么npm安装了很多意外的模块? [英] Why npm installed lots of unexpected modules?

查看:51
本文介绍了为什么npm安装了很多意外的模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用laravel-5.1,与此package.json { "private": true, "devDependencies": { "gulp": "^3.8.8" }, "dependencies": { "laravel-elixir": "^4.0.0", "bootstrap-sass": "^3.0.0" } }

I'm using laravel-5.1,with this package.json { "private": true, "devDependencies": { "gulp": "^3.8.8" }, "dependencies": { "laravel-elixir": "^4.0.0", "bootstrap-sass": "^3.0.0" } }

在根目录下,我在项目根目录下使用npm install命令安装laravel-elixirbootstrap-sass.
npm安装完成后,我发现在我的node_modules目录下有30多个节点模块,在项目根目录下有许多.cmd文件!
现在我已经使用git来回滚我的项目,如何使用npm正确安装laravel-elixirbootstrap-sass?

under root directory,I use npm install command under project root to install laravel-elixir and bootstrap-sass.
After npm installation finished, I found there were more than 30 node modules under my node_modules diretory,and lots of .cmd files under project root!
Now I have used git to rollback my project,how to install laravel-elixir and bootstrap-sass correctly using npm?

推荐答案

因为每个依赖项可能自己依赖于其他依赖项,所以也是如此.

Because each dependency may depend it self on other dependencies and so one.

例如,如果您要安装单个依赖项,最终可能会得到 10个或更多依赖项.

For example if you want to install a single dependency you may end up with 10 or more dependencies.

另一个示例是,当您安装 bootstrap 时,您会得到

Another example is when you install bootstrap you end up with jQuery installed also because Bootstrap depends on jQuery.

这篇关于为什么npm安装了很多意外的模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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