laravel 未找到流明命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39097469/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 14:21:24  来源:igfitidea点击:

Lumen command not found

laravelterminalinstallcomposer-phplumen

提问by Leslie

I'm trying to install lumen for my new project. While using the lumen command in terminal it says " Command not found "

我正在尝试为我的新项目安装 lumen。在终端中使用 lumen 命令时,它说“找不到命令”

Image of my terminal commands

我的终端命令的图像

  1. composer global require "laravel/lumen-installer"
  2. lumen new firstapp
  1. composer global 需要“laravel/lumen-installer”
  2. 流明新的第一个应用程序

What's wrong?

怎么了?

回答by Pranab

You can directly create your project by using composer using the following command :

您可以使用 Composer 使用以下命令直接创建您的项目:

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

回答by Wouter Van Damme

Make sure to place the ~/.composer/vendor/bin directory in your PATH so the lumen executable can be located by your system.

确保将 ~/.composer/vendor/bin 目录放在您的 PATH 中,以便您的系统可以找到 lumen 可执行文件。

回答by José Lozano Hernandez

I'm using:

我正在使用:

  • Ubuntu 18.04
  • Fish shell
  • Ubuntu 18.04
  • 鱼壳

In

~/.config/fish/config.fish

~/.config/fish/config.fish

Put this

把这个

set -x COMPOSER_HOME ~/.config/composer/vendor/bin
set PATH $COMPOSER_HOME $PATH

回答by BILAL MALIK

Lumen utilizes Composer to manage its dependencies. So, before using Lumen, make sure you have Composer installed on your machine.

Lumen 使用 Composer 来管理其依赖项。因此,在使用 Lumen 之前,请确保您的机器上安装了 Composer。

Via Lumen Installer First, download the Lumen installer using Composer:

通过 Lumen 安装程序首先,使用 Composer 下载 Lumen 安装程序:

cmd - composer global require "laravel/lumen-installer".

cmd - composer global 需要“laravel/lumen-installer”。

Also make sure you are using PHP 7+ version.

还要确保您使用的是 PHP 7+ 版本。

src- :https://lumen.laravel.com/docs/5.7

src-:https: //lumen.laravel.com/docs/5.7

You need to install Composer before running the command. It better to install composer as global if you're new to it. I installed composer directly in C directory as global.

您需要在运行命令之前安装 Composer。如果您是新手,最好将 composer 安装为全局。我直接在 C 目录中安装了 Composer 作为全局。

Run this command for installing composer

运行此命令以安装 Composer

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

Or download exe if you dont want to install using CLI.

如果您不想使用 CLI 安装,或者下载 exe。

Download and run Composer-Setup.exe https://getcomposer.org/download/

下载并运行 Composer-Setup.exe https://getcomposer.org/download/

SRC- https://getcomposer.org/download/

SRC- https://getcomposer.org/download/