php - 找不到稳定性稳定的包/laravel/laravel

标签 php linux laravel

Could not find package /laravel/laravel with stability stable.

所以当我尝试使用以下命令创建新的 laravel 项目时出现了该错误:

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

如果我只尝试 laravel 新项目,我会得到: laravel: 找不到命令

但是 laravel 已安装,如果我移动到它的安装文件夹(即 ~/.config/composer/vendor/laravel/installer),然后输入:

php laravel new project

然后它就可以工作了,但是我得到一堆 * 建议安装 *。例如:

laravel/framework suggests installing symfony/psr-http-message-bridge (Required to use psr7 bridging features (0.2.*).)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)

还有更多。

我正在使用 Linux Mint Cinnamon 64 位和 LAMP。

最佳答案

Laravel's extensive documentation 中涵盖了您需要的一切.

Via Composer Create-Project

Alternatively, you may also install Laravel by issuing the Composer create-project command in your terminal:

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

注意 laravel/laravel 中没有前面的斜杠。

要使安装程序正常工作,您可以再次引用文档:

Via Laravel Installer

First, download the Laravel installer using Composer:

composer global require "laravel/installer" Make sure to place the $HOME/.composer/vendor/bin directory (or the equivalent directory for your OS) in your $PATH so the laravel executable can be located by your system.

Once installed, the laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog will create a directory named blog containing a fresh Laravel installation with all of Laravel's dependencies already installed:

laravel new blog

您可以阅读有关更改 $PATH 变量的更多信息 here

关于php - 找不到稳定性稳定的包/laravel/laravel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41349538/

相关文章:

php - 如何在 PHP 中删除 HTML 标签以及字符串中的 HTML 内容?

linux - 使用配置文件启动 mongod 时出现未知选项

c++ - 线程安全,无锁增量函数?

mysql - 如何在 Laravel 中按字符和数字排序

php - 在 PHP 中验证新文件类型 (*.lsr) (Laravel 5.1)

PHP 和 ffmpeg - 为 JW Player 即时转换为 H.264

php - session_start() 永远保持文件加载

linux - 无法安装/修复咖啡因(咖啡因)

php - 如何显示 ModelNotFoundException laravel 的 404

php - 如何在 Laravel Socialite 中使用 Oauth2 Provider 代替 Oauth1?