0

So I got my computer back from maintenance, and had to format it. Now I'm trying to re-install everything I had but I'm having trouble installing Laravel. I'm running on a Linux Mint 19.3 OS. I already have PHP installed with all laravel dependecies installed. I installed Composer and when I try to run

composer global require "laravel/installer"

I get this:

Changed current directory to /home/gustavo/.config/composer
Using version ^4.0 for laravel/installer
./composer.json has been updated
Running composer update laravel/installer
Loading composer repositories with package information
Updating dependencies
Lock file operations: 12 installs, 0 updates, 0 removals
  - Locking laravel/installer (v4.0.5)
  - Locking psr/container (1.0.0)
  - Locking symfony/console (v5.1.8)
  - Locking symfony/polyfill-ctype (v1.20.0)
  - Locking symfony/polyfill-intl-grapheme (v1.20.0)
  - Locking symfony/polyfill-intl-normalizer (v1.20.0)
  - Locking symfony/polyfill-mbstring (v1.20.0)
  - Locking symfony/polyfill-php73 (v1.20.0)
  - Locking symfony/polyfill-php80 (v1.20.0)
  - Locking symfony/process (v5.1.8)
  - Locking symfony/service-contracts (v2.2.0)
  - Locking symfony/string (v5.1.8)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 12 installs, 0 updates, 0 removals
  - Installing symfony/polyfill-php80 (v1.20.0): Extracting archive
  - Installing symfony/process (v5.1.8): Extracting archive
  - Installing symfony/polyfill-mbstring (v1.20.0): Extracting archive
  - Installing symfony/polyfill-intl-normalizer (v1.20.0): Extracting archive
  - Installing symfony/polyfill-intl-grapheme (v1.20.0): Extracting archive
  - Installing symfony/polyfill-ctype (v1.20.0): Extracting archive
  - Installing symfony/string (v5.1.8): Extracting archive
  - Installing psr/container (1.0.0): Extracting archive
  - Installing symfony/service-contracts (v2.2.0): Extracting archive
  - Installing symfony/polyfill-php73 (v1.20.0): Extracting archive
  - Installing symfony/console (v5.1.8): Extracting archive
  - Installing laravel/installer (v4.0.5): Extracting archive
6 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
10 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

I remember that usually the laravel installation end with "Build something amazing!" but I didn't get that phrase this time. And now, if try

Laravel new

It says Command not found. As if Laravel was never installed. What am I doing wrong?

Saud
  • 859
  • 1
  • 9
  • 23
  • Make sure to place the ~/.composer/vendor/bin directory in your PATH – Maatoug Omar Oct 29 '20 at 12:28
  • looks like your path variable is not set. You need to set the path variable. If you need to check whether laravel is installed correctly or not, you can run this command: `composer create-project --prefer-dist laravel/laravel blog`. – Saud Oct 29 '20 at 12:31
  • Sorry, I'm a linux noob. Couple questions: Is it my Composer or my Laravel that I need to set in PATH variable? How do I do that in Linux? – Gustavo Araújo Oct 29 '20 at 12:54

2 Answers2

1

You need to set your path variable. I don't know how to do it in linux since I'm a windows user but, you can easily find it on Laravel's official documentation. If you're still having some trouble setting the $PATH variable you can see this answer or maybe read about it from the scratch here.

You can also create a new project like this without setting a path variable:

// From the official documentation...
composer create-project --prefer-dist laravel/laravel blog
Saud
  • 859
  • 1
  • 9
  • 23
0

On most linux distros you need to add ~/.composer/vendor/bin to the $PATH environment variable.

If you are using bash, you can add it to ~/.bashrc with this line

export PATH=$PATH:~/.composer/vendor/bin

David Barker
  • 14,484
  • 3
  • 48
  • 77