I installed Laravel/Ui in Fresh Laravel 9 for setup ReactJs
I was run below commands step by step in cli
composer require laravel/ui
php artisan ui react
npm install
now when i run npm install
command then it throw error about "unable to resolve dependency tree" as like below
microtech-007@microtech-007:/var/www/html/laravel-cms$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: vite@4.0.4
npm ERR! node_modules/vite
npm ERR! dev vite@"^4.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^3.0.0" from @vitejs/plugin-react@2.2.0
npm ERR! node_modules/@vitejs/plugin-react
npm ERR! dev @vitejs/plugin-react@"^2.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/microtech-007/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/microtech-007/.npm/_logs/2023-01-10T09_34_09_381Z-debug-0.log
additional :- if you tried to setup VueJs using laravel/ui then you may got error as like below during running the npm install
command
microtech-007@microtech-007:/var/www/html/laravel-cms$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: vite@4.0.4
npm ERR! node_modules/vite
npm ERR! dev vite@"^4.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^3.0.0" from @vitejs/plugin-vue@3.2.0
npm ERR! node_modules/@vitejs/plugin-vue
npm ERR! dev @vitejs/plugin-vue@"^3.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/microtech-007/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/microtech-007/.npm/_logs/2023-01-10T09_54_29_026Z-debug-0.log