NPM / Bower / Composer - 差异? [英] NPM/Bower/Composer - differences?

查看:3568
本文介绍了NPM / Bower / Composer - 差异?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以向我解释 NPM Bower Composer

Can someone explain to me the difference between NPM, Bower and Composer.

他们都是包管理器 - 是正确的吗?

They are all package managers - correct?

使用?

此外,每个似乎有一个json文件伴随它,这是否存储所有你需要的包,以便他们可以通过cmd行安装?为什么需要此文件?

Also, each one appears to have a json file that accompanies it, does this store all the packages you require so they can be installed by cmd line? Why do you need this file?

推荐答案

npm 是nodejs包管理器。因此,它瞄准nodejs环境,这通常意味着服务器端nodejs项目或命令行项目(bower本身是一个npm包)。如果你要对nodejs做任何事情,那么你将要使用npm。

npm is nodejs package manager. It therefore targets nodejs environments, which usually means server-side nodejs projects or command-line projects (bower itself is a npm package). If you are going to do anything with nodejs, then you are going to use npm.

bower 经理,旨在(前端)web项目。您需要npm和nodejs来安装bower并执行它,尽管bower包不是专门用于nodejs,而是用于浏览器环境。

bower is a package manager that aims at (front-end) web projects. You need npm and nodejs to install bower and to execute it, though bower packages are not meant specifically for nodejs, but rather for the "browser" environment.

composer 是一个依赖项管理器,目标是php项目。

composer is a dependency manager that targets php projects. If you are doing something with symfony (or plain old php), this is likely the way to go

总结:


  • 执行节点?你做npm

  • 做php吗?尝试作曲家

  • 前端javascript? try bower

是的,json文件描述了基本的包信息和依赖。是的,他们是需要的。

And yes, the "json" files describe basic package information and dependencies. And yes, they are needed.

现在,README怎么样? : - )

Now, what about the READMEs? :-)

  • https://github.com/bower/bower
  • https://www.npmjs.org/doc/cli/npm.html
  • https://getcomposer.org/doc/00-intro.md

这篇关于NPM / Bower / Composer - 差异?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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