Daniel Jørgensen
Daniel Jørgensen

Reputation: 1202

laravel: command not found while trying to install laravel

I'm trying to install Laravel on a Raspberry Pi but I'm facing some problems after installing composer

Composer seems to be working fine as writing composer gives me the expected output with all possible commands.

According to Laravels own installation documentation i shall run the following command after i have installed Composer: composer global require "laravel/installer", which seems to be working as no errors are shown. After this i need to add the ~/.composer/vendor/bin path to my $PATH variable which i do and confirm by writing echo $PATH that gives me the following output: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.composer/vendor/bin

However running the laravel command afterwards just gives me -bash: laravel: command not found.

Can someone assist in what I am missing?

Upvotes: 0

Views: 503

Answers (2)

Beginner
Beginner

Reputation: 9135

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

Upvotes: 1

Jesús Amieiro
Jesús Amieiro

Reputation: 2483

If you are trying to create a new project, using this command

laravel new project_name

You can use the Composer alternative

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

You can find more info in the official documentation.

Upvotes: 0

Related Questions