【发布时间】:2023-01-10 19:06:32
【问题描述】:
我在 Fresh Laravel 9 中安装了Laravel/Ui 进行设置ReactJs
我在 cli 中一步一步地按照命令运行
composer require laravel/ui
php artisan ui react
npm install
现在,当我运行npm install 命令时,它会抛出关于“无法解析依赖树”的错误,如下所示
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
附加:- 如果您尝试设置浏览器使用拉维/用户界面然后在运行npm install命令时可能会出现如下错误
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
【问题讨论】:
标签: reactjs vue.js npm laravel-9 laravel-ui