8

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

Image of my terminal commands

  1. composer global require "laravel/lumen-installer"
  2. lumen new firstapp

What's wrong?

Leslie
  • 81
  • 2
  • 8

6 Answers6

7

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

composer create-project --prefer-dist laravel/lumen firstapp
Pranab
  • 191
  • 1
  • 11
5

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

Wouter Van Damme
  • 761
  • 9
  • 15
  • 1
    Yes I suppose this is the correct PATH : /Users/lesliebuying/.composer/vendor/bin/lumen – Leslie Aug 23 '16 at 09:37
  • 3
    put this in the terminal: echo 'export PATH="$PATH:$HOME/.composer/vendor/bin"' >> ~/.bashrc so bash knows where to found the lumen command – Wouter Van Damme Aug 23 '16 at 09:41
1

I'm using:

  • Ubuntu 18.04
  • Fish shell

In

~/.config/fish/config.fish

Put this

set -x COMPOSER_HOME ~/.config/composer/vendor/bin
set PATH $COMPOSER_HOME $PATH
José Lozano Hernández
  • 1,813
  • 1
  • 17
  • 21
0

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

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

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

Also make sure you are using PHP 7+ version.

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.

Run this command for installing 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.

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

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

BILAL MALIK
  • 141
  • 1
  • 15
0

This solved my problem:

export PATH="$HOME/.composer/vendor/bin:$PATH"

Thanks for: https://gist.github.com/malitov/5867e86415e2a987260f2394bc04da8e

Ahmed Ismail
  • 912
  • 11
  • 21
0

You are getting this error just because either Lumen is not installed Globally inside your PC or the bin path is not set inside your PC.

Please do one thing by just checking whether Lumen is available inside the terminal or not. If not available then install by composer global require "laravel/lumen-installer"

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

NIKUNJ PATEL
  • 2,034
  • 1
  • 7
  • 22