我试图通过brew安装作曲家:
在usr/local/bin
(这不是在Mavricks和我不得不个人)我做到了。
brew tap josegonzalez/homebrew-php
brew install josegonzalez/php/composer
我可以运行php composer.phar
,但是当我这样做php composer.phar install
,我得到的错误:
Composer could not find a composer.json file in /usr/local/bin To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section
所以我去看https://getcomposer.org/doc/00-intro.md
。CRTL + F“.json”,没有什么。严肃作曲?
编辑:我想做的是有composer
可执行文件php composer.phar
。这在现在从这里工作。
正确答案
月 | “入门”页面是,显然没有注意到,文档的介绍。大多数文档将从安装说明开始,就像Composer的做法一样。 包含该 我建议阅读完整的文档,以便您更好地了解如何使用Composer。我还建议删除您所拥有的,并按照文档中提供的安装说明。 | ||
添加评论 |
2 | 要安装作曲家并添加到您的全局路径:
在终端运行这些。它说,如果你得到一个错误,usr不存在,你需要手动使它。我知道答案被选中,所以这是任何人谁可能看到这在未来,因为我有时,不想被告知访问另一个网站。它的简单只是两行,可能必须在sudo如果你有权限错误 | ||
日 | 在我的情况下,我没有复制所有的项目文件到我正在运行的文件夹
如果您只想让作曲家运行,请创建一个新
然后运行 | ||
70年 | 简单的解决方案是通过这个命令安装:
要安装包非常简单:
|
来自 http://stackoverflow.com/questions/31900211/composer-could-not-find-a-composer-json
3 | I tried to install composer via brew per: In
I can run
So I go to the EDIT: What I was trying to do was to have | |||
4 | The "Getting Started" page is, as you obviously didn't notice, the introduction to the documentation. Most documentation will start off with installation instructions, just like Composer's do. The page that contains information on the I'd recommend reading over the documentation in full, so that you gain a better understanding of how to use Composer. I'd also recommend removing what you have and following the installation instructions provided in the documentation. | ||
2 | To install composer and add to your global path:
run these in terminal. It does say if you get an error that usr doesn't exist, you do need to manually make it. I know an answer was selected, so this is for anyone who may see this in the future, as i am sometimes, and don't want to be advised to visit yet another site. Its simple just two lines, might have to be in sudo if you have permission error | ||
1 | In my case, I did not copy all project files to the folder where I was running
If you just want to make composer run, create a new
Then run | ||
0 | Simple solution is install via this command :
To install package it's very simple :
|