Why npm installed lots of unexpected modules?

白昼怎懂夜的黑 提交于 2019-12-12 04:24:27

问题


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" } }

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?


回答1:


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

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

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




回答2:


These dependencies might require other dependencies, so it will install them aswell.



来源:https://stackoverflow.com/questions/38325883/why-npm-installed-lots-of-unexpected-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!