I'm trying to install lumen for my new project. While using the lumen command in terminal it says " Command not found "
- composer global require "laravel/lumen-installer"
- lumen new firstapp
What's wrong?
I'm trying to install lumen for my new project. While using the lumen command in terminal it says " Command not found "
What's wrong?
You can directly create your project by using composer using the following command :
composer create-project --prefer-dist laravel/lumen firstapp
Make sure to place the ~/.composer/vendor/bin directory in your PATH so the lumen executable can be located by your system.
I'm using:
In
~/.config/fish/config.fish
Put this
set -x COMPOSER_HOME ~/.config/composer/vendor/bin
set PATH $COMPOSER_HOME $PATH
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/
This solved my problem:
export PATH="$HOME/.composer/vendor/bin:$PATH"
Thanks for: https://gist.github.com/malitov/5867e86415e2a987260f2394bc04da8e
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.