通过composer安装laravel InvalidArgumentException

时间:2013-12-08 02:06:33

标签: php xampp laravel-4 composer-php

我想安装laravel 4.x,如你所知必须使用作曲家。
我试过了:
composer create-project laravel/laravel d:\xampp\htdocs\laravel

  [InvalidArgumentException]
  Could not find package laravel/laravel with stability stable.


create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs][--no-install] [package] [directory] [version]

我从github repo下载了laravel然后尝试了这个:la composer install
这次我得到了:

Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package laravel/framework could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

我正在使用:

Apache 2.4.7
PHP 5.5.6

xampp-win32-1.8.3-1-VC11安装在win8 64bit

请帮帮我

感谢

2 个答案:

答案 0 :(得分:4)

你忘记添加“--prefer-dist “所以在你的情况下,你必须使用:

composer create-project laravel/laravel --prefer-dist

为了让它发挥作用。所以只需删除所有文件:d:\ xampp \ htdocs \ laravel,然后按照以下命令重试你的cmd(我猜你使用的是Windows!):

cd d:\xampp\htdocs\laravel
composer create-project laravel/laravel --prefer-dist

我认为这应该对你有用

答案 1 :(得分:1)

你是否安装了没有任何错误的作曲家?我想我之前遇到过同样的错误,问题在于作曲家安装。