Jetstream by default installs inertia with Vue JS version 3 even though we can select the inertia version when just installing Inertia.
Few of the Vue plugins I have planned to use still do not have Vue3 support. So is it possible to install Jetstream with Vue JS 2?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
yes, you can use old jetstream version.
jetstream version 2.2.0 support with vue3 before that it will support vue2. But it might contain some bugs.
To install jetstream with vue2 run comment on terminal
laravel new hello cd hello
edit composer.json "laravel/jetstream": "^2.1",
then run composer install; php artisan jetstream:install inertia
on terminal.
And finally run npm install; npm run dev; php artisan migrate
on terminal.
Method 2
@bapi is right, you need to use an older version of Laravel Jetstream
.
You need to use the exact jetstream which is "laravel/jetstream": "2.1.4"
instead of "laravel/jetstream": "^2.1"
which installs inertiajs
with vuejs2
.
See changelogs here from the official repo https://github.com/laravel/jetstream/blob/2.x/CHANGELOG.md
Method 3
@bapi is not right @kikuyu1 has the better answer, follow these exact steps to solve the issue on a fresh project
- add
laravel/jetstream": "2.1.4"
to your"require"
dependencies in yourcomposer.json
file - run
composer update
- run
php artisan jetstream:install inertia
- run
npm install
- run
npm run dev
- run
php artisan migrate
Now your Laravel 8 project should have Laravel Jetstream install with vue 2
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0