gpt4 book ai didi

php - 通过 Composer InvalidArgumentException 安装 laravel

转载 作者:行者123 更新时间:2023-12-03 23:02:09 26 4
gpt4 key购买 nike

我想安装 laravel 4.x,如你所知,我必须使用 composer。
我试过了:
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然后尝试了这个:
Composer 安装
这次我得到了:

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 上安装

请帮帮我

谢谢

最佳答案

您忘记添加“--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

我认为这对你来说应该很好

关于php - 通过 Composer InvalidArgumentException 安装 laravel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20449020/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com