Mehdi Jalali
Mehdi Jalali

Reputation: 29

laravel 8 installation failed

i use this command for install laravel + Authentication

composer global require laravel/installer
laravel new laravel--jet

Laravel Installer 4.0.2
but showing this error on cmd:

Which Jetstream stack do you prefer?
  [0] livewire
  [1] inertia
 >

  Aborted.

and i using this commands:

composer create-project --prefer-dist laravel/laravel laravel
composer require laravel/jetstream
php artisan jetstream:install livewire/inertia

but showing this error when run project:

Error
Class 'Inertia\Inertia' not found

and resource>view folder not contain auth files
how to resolve this problem?

Upvotes: 1

Views: 17884

Answers (7)

Ishan K Rajani
Ishan K Rajani

Reputation: 1

Dear following steps are required in sequence to reach to final output.

to create project

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

for generating artisan key

php artisan key:generate

to include jetstream

composer require laravel/jetstream

to include livewire(which will eliminate your above mentioned error)

php artisan jetstream:install livewire

open project folder in text editor and go to database/migrations table because you will have login and register screen with jetstream. You can eliminate this table creation step if you want. below is the sample code for table creation you can add or remove the filed as per your requirement its just a sample

finally, go for it

php artisan serve

Upvotes: 0

Leonardo Magnani
Leonardo Magnani

Reputation: 1

If your application is still returning "Class 'Inertia\Inertia' not found" after try to install jetstream livewire, pay attention if your composer is installed globally. If you are using composer just locally in this project with the file composer.phar, will need to install globally in your machine.

After the installation, remove the last migration inserted by JetStream "2023_03_14_184752_create_sessions_table.php" and run command on the prompt again.

  1. Install Composer globally (https://getcomposer.org/download/)
  2. Run --> composer require laravel/jetstream
  3. Run --> php artisan jetstream:install livewire

Upvotes: 0

Narendra
Narendra

Reputation: 21

Try to update laravel installer:

composer global remove laravel/installer composer global require laravel/installer To check the version of the installer:

laravel -V

It seams that the issue only occurs on PowerShell and cmd it works using git bash

Upvotes: 0

epv
epv

Reputation: 31

Try to update laravel installer:

composer global remove laravel/installer
composer global require laravel/installer

To check the version of the installer:

laravel -V

next:

laravel new yourAppName --jet --stack=inertia or livewire

works with cmd or git or any other... good coding ;)

Upvotes: 3

Dino Cajic
Dino Cajic

Reputation: 138

If you're using Windows, try using Git Bash...it should come pre-installed on Windows 10. CMD tends to throw that error.

In Git Bash laravel new project-name --jet

Upvotes: 0

albus_severus
albus_severus

Reputation: 3702

you should install (inertia or livewire, not both!)

php artisan jetstream:install inertia //(inertia or livewire, not both!)

Upvotes: 8

Marcos Jesus
Marcos Jesus

Reputation: 19

try to update composer packages and then reinstall

Upvotes: 0

Related Questions